Interface CommandTargetResolver
- All Known Implementing Classes:
AnnotationCommandTargetResolver,MetaDataCommandTargetResolver
public interface CommandTargetResolver
Interface towards a mechanism that is capable of extracting an Aggregate Identifier and Version form a command that
identifies the aggregate instance the command should be invoked on.
- Since:
- 1.2
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionresolveTarget(CommandMessage<?> command) Returns the Aggregate Identifier and optionally the expected version of the aggregate on which the givencommandshould be executed.
-
Method Details
-
resolveTarget
Returns the Aggregate Identifier and optionally the expected version of the aggregate on which the givencommandshould be executed.The version may be
nullif no specific version is required. Furthermore, the returnedVersionedAggregateIdentifiermay be null entirely when the givencommandis targeted towards aCreationPolicyannotated command handler that (optionally) constructs a new aggregate instance.- Parameters:
command- The command from which to extract the identifier and version.- Returns:
- A
VersionedAggregateIdentifierinstance reflecting the aggregate to execute the command on, ornullwhen thecommandis targeted towards aCreationPolicyannotated command handler that constructs a new aggregate instance. - Throws:
IllegalArgumentException- If the command is not formatted correctly to extract this information.- See Also:
-