Package com.opencqrs.framework.command
Interface CommandHandler.ForCommand<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.ForCommand<I,C extends Command,R>
extends CommandHandler<I,C,R>
FunctionalInterface
to be implemented, if only the Command
is needed for execution. This is
typically used for Command.SubjectCondition.PRISTINE
commands, for which no instance state is available.
However, the usage of this interface does not imply pristine semantics. Make sure to implement your Command
accordingly, if needed.-
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
Modifier and TypeMethodDescriptionhandle
(C command, CommandEventPublisher<I> commandEventPublisher) Handles the given command without having access to the event-sourced instance representing the current state (aka write model).
-
Method Details
-
handle
Handles the given command without having access to the event-sourced instance representing the current state (aka write model). The givenCommandEventPublisher
enables the publication of new events upon successful command execution.- Parameters:
command
- the command payload to be executedcommandEventPublisher
- a callback to publish new events- Returns:
- a generic command execution result, may be
null
-