Record Class SagaStepDefinition

java.lang.Object
java.lang.Record
org.j7m.middleware.api.saga.SagaStepDefinition
Record Components:
stepId - stable step identifier within the definition
type - dispatch type for the step
action - executable step action
compensation - optional compensation action for a successful step
retryPolicy - retry policy override for the step
timeoutPolicy - 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 Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stepId

      public SagaStepId stepId()
      Returns the value of the stepId record component.
      Returns:
      the value of the stepId record component
    • type

      public SagaStepType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • action

      public SagaStepAction action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component
    • compensation

      public SagaCompensationAction compensation()
      Returns the value of the compensation record component.
      Returns:
      the value of the compensation record component
    • retryPolicy

      public SagaRetryPolicy retryPolicy()
      Returns the value of the retryPolicy record component.
      Returns:
      the value of the retryPolicy record component
    • timeoutPolicy

      public SagaTimeoutPolicy timeoutPolicy()
      Returns the value of the timeoutPolicy record component.
      Returns:
      the value of the timeoutPolicy record component