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 Type
    Method
    Description
    resolveTarget(org.axonframework.commandhandling.CommandMessage<?> command)
    Returns the Aggregate Identifier and optionally the expected version of the aggregate on which the given command should be executed.
  • Method Details

    • resolveTarget

      VersionedAggregateIdentifier resolveTarget(@Nonnull org.axonframework.commandhandling.CommandMessage<?> command)
      Returns the Aggregate Identifier and optionally the expected version of the aggregate on which the given 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.

      Parameters:
      command - The command from which to extract the identifier and version.
      Returns:
      A 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.
      Throws:
      IllegalArgumentException - If the command is not formatted correctly to extract this information.
      See Also: