Record Class SagaOptions
java.lang.Object
java.lang.Record
org.j7m.middleware.api.saga.SagaOptions
- Record Components:
idempotencyKey- optional key used to detect duplicate saga startsretryPolicy- default retry policy for steps without an overridetimeoutPolicy- default timeout policy for the saga executioncancellationPolicy- cancellation behavior for this execution
- All Implemented Interfaces:
Serializable
public record SagaOptions(IdempotencyKey idempotencyKey, SagaRetryPolicy retryPolicy, SagaTimeoutPolicy timeoutPolicy, SagaCancellationPolicy cancellationPolicy)
extends Record
implements Serializable
Options used when starting a saga.
Options are persisted with the execution and recovered with the original policy values. They are immutable and safe for durable event encoding.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSagaOptions(IdempotencyKey idempotencyKey, SagaRetryPolicy retryPolicy, SagaTimeoutPolicy timeoutPolicy, SagaCancellationPolicy cancellationPolicy) Creates validated options. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecancellationPolicyrecord component.static SagaOptionsdefaults()Returns default saga start options.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theidempotencyKeyrecord component.Returns the value of theretryPolicyrecord component.Returns the value of thetimeoutPolicyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SagaOptions
public SagaOptions(IdempotencyKey idempotencyKey, SagaRetryPolicy retryPolicy, SagaTimeoutPolicy timeoutPolicy, SagaCancellationPolicy cancellationPolicy) Creates validated options.
-
-
Method Details
-
defaults
Returns default saga start options.- Returns:
- immutable default options with no idempotency key, no retry, no timeout, and compensation on cancel
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
idempotencyKey
Returns the value of theidempotencyKeyrecord component.- Returns:
- the value of the
idempotencyKeyrecord component
-
retryPolicy
Returns the value of theretryPolicyrecord component.- Returns:
- the value of the
retryPolicyrecord component
-
timeoutPolicy
Returns the value of thetimeoutPolicyrecord component.- Returns:
- the value of the
timeoutPolicyrecord component
-
cancellationPolicy
Returns the value of thecancellationPolicyrecord component.- Returns:
- the value of the
cancellationPolicyrecord component
-