public interface CommandTargetResolver
Modifier and Type | Method and Description |
---|---|
VersionedAggregateIdentifier |
resolveTarget(CommandMessage<?> command)
Returns the Aggregate Identifier and optionally the expected version of the aggregate on which the given
command should be executed. |
VersionedAggregateIdentifier resolveTarget(@Nonnull CommandMessage<?> command)
command
should be executed.
The version may be null
if no specific version is required. Furthermore, the returned
VersionedAggregateIdentifier
may be null entirely when the given command
is targeted towards a
CreationPolicy
annotated command handler that (optionally) constructs a new aggregate instance.
command
- The command from which to extract the identifier and version.VersionedAggregateIdentifier
instance reflecting the aggregate to execute the command on, or
null
when the command
is targeted towards a CreationPolicy
annotated command handler that
constructs a new aggregate instance.IllegalArgumentException
- If the command is not formatted correctly to extract this information.AggregateCreationPolicy.ALWAYS
,
AggregateCreationPolicy.CREATE_IF_MISSING
Copyright © 2010–2024. All rights reserved.