Interface SagaModel<T>

Type Parameters:
T - The saga type

public interface SagaModel<T>
Interface of a model that describes a Saga of type T. Use the SagaModel to obtain associations and event handlers for the Saga.
  • Method Details

    • resolveAssociation

      Optional<AssociationValue> resolveAssociation(EventMessage<?> eventMessage)
      Returns the AssociationValue used to find sagas of type T that can handle the given eventMessage. If the saga type does not handle events of this type an empty Optional is returned.
      Parameters:
      eventMessage - The event to find the association value for
      Returns:
      Optional of the AssociationValue for the event, or an empty Optional if the saga doesn't handle the event
    • findHandlerMethods

      List<MessageHandlingMember<? super T>> findHandlerMethods(EventMessage<?> event)
      Returns a List of MessageHandlingMember that can handle the given event.
      Parameters:
      event - The EventMessage to be handled
      Returns:
      event message handlers for the given event
    • hasHandlerMethod

      default boolean hasHandlerMethod(EventMessage<?> eventMessage)
      Indicates whether the Saga described by this model has a handler for the given eventMessage
      Parameters:
      eventMessage - The message to check the availability of a handler for
      Returns:
      true if there the Saga has a handler for this message, otherwise false
    • modelFactory

      SagaMetaModelFactory modelFactory()
      Returns the factory that created this model.
      Returns:
      The factory that made this model