Package com.opencqrs.framework.command
Interface CommandHandler.ForInstanceAndCommand<I,C extends Command,R>
- Type Parameters:
I
- the generic type of the instance to be event sourced before handling the commandC
- the command typeR
- the command execution result type
- All Superinterfaces:
CommandHandler<I,
C, R>
- Enclosing interface:
CommandHandler<I,
C extends Command, R>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static non-sealed interface CommandHandler.ForInstanceAndCommand<I,C extends Command,R>
extends CommandHandler<I,C,R>
FunctionalInterface
to be implemented, if Command
and event-sourced instance are needed for
execution.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.opencqrs.framework.command.CommandHandler
CommandHandler.ForCommand<I,
C extends Command, R>, CommandHandler.ForInstanceAndCommand<I, C extends Command, R>, CommandHandler.ForInstanceAndCommandAndMetaData<I, C extends Command, R> -
Method Summary
-
Method Details
-
handle
Handles the given command on an event-sourced instance representing the current state (aka write model). The instance is sourced prior to calling this method based onCommandHandlerDefinition.sourcingMode()
and a set of configuredStateRebuildingHandler
s. The givenCommandEventPublisher
enables the publication of new events upon successful command execution.- Parameters:
instance
- the event-sourced instance the command is targeted atcommand
- the command payload to be executedcommandEventPublisher
- a callback to publish new events- Returns:
- a generic command execution result, may be
null
-