CommandFactory

public final class CommandFactory

A factory of Command instances.

Uses the given ActorRequestFactory as a source of command meta information such as the actor, the tenant, and others.

The command messages passed to the factory are validated according to their Proto definitions. If a given message is invalid, a ValidationException is thrown.

See also

Functions

Link copied to clipboard
public Command create(CommandMessage message)
Creates a new Command with the given message.
public Command create(CommandMessage message, int targetVersion)
Creates a new Command with the passed message and target entity version.
Link copied to clipboard
public Command createBasedOnContext(CommandMessage message, CommandContext context)
Creates new Command with the passed message using the existing context.