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 Summary
Modifier and TypeMethodDescriptionfindHandlerMethods(org.axonframework.eventhandling.EventMessage<?> event) Returns aListofMessageHandlingMemberthat can handle the given event.default booleanhasHandlerMethod(org.axonframework.eventhandling.EventMessage<?> eventMessage) Indicates whether the Saga described by this model has a handler for the giveneventMessageReturns the factory that created this model.resolveAssociation(org.axonframework.eventhandling.EventMessage<?> eventMessage)
-
Method Details
-
resolveAssociation
Optional<AssociationValue> resolveAssociation(org.axonframework.eventhandling.EventMessage<?> eventMessage) Returns theAssociationValueused to find sagas of typeTthat can handle the giveneventMessage. 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<org.axonframework.messaging.annotation.MessageHandlingMember<? super T>> findHandlerMethods(org.axonframework.eventhandling.EventMessage<?> event) Returns aListofMessageHandlingMemberthat can handle the given event.- Parameters:
event- TheEventMessageto be handled- Returns:
- event message handlers for the given
event
-
hasHandlerMethod
default boolean hasHandlerMethod(org.axonframework.eventhandling.EventMessage<?> eventMessage) Indicates whether the Saga described by this model has a handler for the giveneventMessage- Parameters:
eventMessage- The message to check the availability of a handler for- Returns:
trueif there the Saga has a handler for this message, otherwisefalse
-
modelFactory
SagaMetaModelFactory modelFactory()Returns the factory that created this model.- Returns:
- The factory that made this model
-