Enum Class OutboundCorrelationStrategy
java.lang.Object
java.lang.Enum<OutboundCorrelationStrategy>
org.mule.runtime.extension.api.runtime.parameter.OutboundCorrelationStrategy
- All Implemented Interfaces:
Serializable,Comparable<OutboundCorrelationStrategy>,Constable
@MinMuleVersion("4.1")
public enum OutboundCorrelationStrategy
extends Enum<OutboundCorrelationStrategy>
Lists the possible strategies to determine the correlation id that should be sent on an outbound operation which supports
correlation.
Operations should invoke the getOutboundCorrelationId(CorrelationInfo, String) method to obtain the actual value. If
empty, then no correlation id should be sent.
- Since:
- 1.1
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis strategy always yields a correlation id, regardless ofCorrelationInfo.isOutboundCorrelationEnabled()Whether to send a correlation id or not is defined by checking theCorrelationInfo.isOutboundCorrelationEnabled()method.This strategy always returnsOptional.empty() -
Method Summary
Modifier and TypeMethodDescriptiongetOutboundCorrelationId(CorrelationInfo correlationInfo, String customCorrelationId) Determines the correlation id that should be sent through an outbound operation (if any).static OutboundCorrelationStrategyReturns the enum constant of this class with the specified name.static OutboundCorrelationStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Whether to send a correlation id or not is defined by checking theCorrelationInfo.isOutboundCorrelationEnabled()method. If that method returnsfalse, then anOptional.empty()value is returned. Otherwise, the same behavior asALWAYSwill be used -
ALWAYS
This strategy always yields a correlation id, regardless ofCorrelationInfo.isOutboundCorrelationEnabled() -
NEVER
This strategy always returnsOptional.empty()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getOutboundCorrelationId
public abstract Optional<String> getOutboundCorrelationId(CorrelationInfo correlationInfo, String customCorrelationId) Determines the correlation id that should be sent through an outbound operation (if any).Depending on each strategy implementation, this method might return a
customCorrelationId, the value ofCorrelationInfo.getCorrelationId()or anOptional.empty()value.- Parameters:
correlationInfo- the current correlation infocustomCorrelationId- a custom correlation id set at the operation level. Usenullif no custom value defined- Returns:
- an optioanl correlation id value
-