Package com.opencqrs.framework.command
Class CommandEventCapturer<I>
java.lang.Object
com.opencqrs.framework.persistence.EventCapturer
com.opencqrs.framework.command.CommandEventCapturer<I>
- Type Parameters:
I
- the instance as defined by theCommandHandlerDefinition
being executed
- All Implemented Interfaces:
CommandEventPublisher<I>
,EventPublisher
Default implementation of
CommandEventPublisher
used by CommandRouter
to apply events to the
StateRebuildingHandler
s relevant for the Command
being executed.-
Constructor Summary
ConstructorsConstructorDescriptionCommandEventCapturer
(I initialInstance, String subject, List<StateRebuildingHandlerDefinition<I, Object>> stateRebuildingHandlerDefinitions) -
Method Summary
Modifier and TypeMethodDescription<E> I
Publishes an event and its meta-data to the subject specified byCommand.getSubject()
and applies it to any assignableStateRebuildingHandler
s participating in the command execution.<E> I
publishRelative
(String subjectSuffix, E event, Map<String, ?> metaData) Publishes an event and its meta-data to the subject specified byCommand.getSubject()
appended with the specified suffix and applies it to any assignableStateRebuildingHandler
s participating in the command execution.Methods inherited from class com.opencqrs.framework.persistence.EventCapturer
getEvents, publish
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.opencqrs.framework.command.CommandEventPublisher
publish, publishRelative
Methods inherited from interface com.opencqrs.framework.persistence.EventPublisher
publish, publish, publish
-
Constructor Details
-
CommandEventCapturer
-
-
Method Details
-
publish
Description copied from interface:CommandEventPublisher
Publishes an event and its meta-data to the subject specified byCommand.getSubject()
and applies it to any assignableStateRebuildingHandler
s participating in the command execution.- Specified by:
publish
in interfaceCommandEventPublisher<I>
- Type Parameters:
E
- the event type- Parameters:
event
- the event to be publishedmetaData
- the event meta-data to be published- Returns:
- an updated or new instance with all events applied
-
publishRelative
Description copied from interface:CommandEventPublisher
Publishes an event and its meta-data to the subject specified byCommand.getSubject()
appended with the specified suffix and applies it to any assignableStateRebuildingHandler
s participating in the command execution.- Specified by:
publishRelative
in interfaceCommandEventPublisher<I>
- Type Parameters:
E
- the event type- Parameters:
subjectSuffix
- the suffix to be appended to theCommand.getSubject()
currently executed, must not start with/
event
- the event to be publishedmetaData
- the event meta-data to be published- Returns:
- an updated or new instance with all events applied
-