Record Class SagaStepDefinition
java.lang.Object
java.lang.Record
org.j7m.middleware.api.saga.SagaStepDefinition
- Record Components:
stepId- stable step identifier within the definitiontype- dispatch type for the stepaction- executable step actioncompensation- optional compensation action for a successful stepretryPolicy- retry policy override for the steptimeoutPolicy- timeout policy override for the step
- All Implemented Interfaces:
Serializable
public record SagaStepDefinition(SagaStepId stepId, SagaStepType type, SagaStepAction action, SagaCompensationAction compensation, SagaRetryPolicy retryPolicy, SagaTimeoutPolicy timeoutPolicy)
extends Record
implements Serializable
Immutable step definition with action and compensation callback.
Actions are executable callbacks registered in-process. Durable recovery restores definition metadata and requires actions to be re-registered before non-terminal executions can resume.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSagaStepDefinition(SagaStepId stepId, SagaStepType type, SagaStepAction action, SagaCompensationAction compensation, SagaRetryPolicy retryPolicy, SagaTimeoutPolicy timeoutPolicy) Creates a validated step definition. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.Returns the value of thecompensationrecord component.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 theretryPolicyrecord component.stepId()Returns the value of thestepIdrecord component.Returns the value of thetimeoutPolicyrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
SagaStepDefinition
public SagaStepDefinition(SagaStepId stepId, SagaStepType type, SagaStepAction action, SagaCompensationAction compensation, SagaRetryPolicy retryPolicy, SagaTimeoutPolicy timeoutPolicy) Creates a validated step definition.
-
-
Method Details
-
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). -
stepId
-
type
-
action
-
compensation
Returns the value of thecompensationrecord component.- Returns:
- the value of the
compensationrecord 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
-