T
- the type of the eventpublic interface EventHandlerContext<T extends Event> extends EventEnvelope<T>
Modifier and Type | Method and Description |
---|---|
<A extends CommandProcessingAggregate<A,CT>,CT extends Command> |
save(java.lang.Class<A> entityClass,
CT command,
java.util.Optional<java.lang.String> entityId)
Creates an aggregate in response to an event
|
<A extends CommandProcessingAggregate<A,CT>,CT extends Command> |
update(java.lang.Class<A> entityClass,
java.lang.String entityId,
CT command)
Updates an aggregate in response to an event
|
<A extends CommandProcessingAggregate<A,CT>,CT extends Command> |
updateWithProvidedCommand(java.lang.Class<A> entityClass,
java.lang.String entityId,
java.util.function.Function<A,java.util.Optional<CT>> commandProvider)
Updates an aggregate in response to an event
|
getEntityId, getEvent, getEventContext, getEventId, getEventMetadata, getEventType, getOffset, getSwimlane
<A extends CommandProcessingAggregate<A,CT>,CT extends Command> java.util.concurrent.CompletableFuture<EntityWithIdAndVersion<A>> save(java.lang.Class<A> entityClass, CT command, java.util.Optional<java.lang.String> entityId)
A
- the aggregate classCT
- the command classentityClass
- the class of the aggregate to create, must be a subclass of CommandProcessingAggregatecommand
- the command to processentityId
- the optional id of the aggregate to create<A extends CommandProcessingAggregate<A,CT>,CT extends Command> java.util.concurrent.CompletableFuture<EntityWithIdAndVersion<A>> update(java.lang.Class<A> entityClass, java.lang.String entityId, CT command)
A
- the aggregate classCT
- the command classentityClass
- the class of the aggregate to create, must be a subclass of CommandProcessingAggregatecommand
- the command to processentityId
- the optional id of the aggregate to create<A extends CommandProcessingAggregate<A,CT>,CT extends Command> java.util.concurrent.CompletableFuture<EntityWithIdAndVersion<A>> updateWithProvidedCommand(java.lang.Class<A> entityClass, java.lang.String entityId, java.util.function.Function<A,java.util.Optional<CT>> commandProvider)
A
- the aggregate classCT
- the command classentityClass
- the class of the aggregate to create, must be a subclass of CommandProcessingAggregatecommandProvider
- provides the command to processentityId
- the optional id of the aggregate to create