CommandAction

class CommandAction @InternalWowApi constructor(val type: CommandType, val ref: AggregateRef, val scope: Scope, val creation: Creation)

What a caller asks to do, as action-level authorization sees it before the body is decoded: a command of type on ref, in scope, and whether the command may create the aggregate (creation).

A creation that names no aggregate is authorized before admission chooses its id: its ref names the aggregate id CommandGateway.UNADDRESSED, as does a transformer's result that names none.

A request a transformer handles is authorized as it arrives, and again as the command it becomes when the transformer changed its type or its aggregate. As it arrives, its ref names the aggregate id CommandGateway.UNADDRESSED when the request names none, and a mounted command, which no aggregate decides, has Creation.NONE.

Constructors

Link copied to clipboard
constructor(type: CommandType, ref: AggregateRef, scope: Scope, creation: Creation)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Whether the command runs the service rather than its domain: a context's schedule jobs (wow.schedule.EnableJob, RescheduleJob, DisableJob), an aggregate type's snapshot rebuild (wow.snapshot.RebuildSnapshot), and an operator's actions on the failure ledger (wow.ledger.*, its read wow.ledger.Read among them). These are the commands Wow allows no caller by default: a node without an authorizer refuses them to every caller. The commands of an aggregate's own lifecycle are not among them.

Link copied to clipboard

Whether the command is one of Wow's system commands (wow.*), of any group: an aggregate's lifecycle commands (wow.lifecycle.DeleteAggregate, RestoreAggregate, TransferOwner, TransferSpace) and its schedule's, a context's schedule jobs, an aggregate type's snapshot rebuild, the failure ledger's actions and its read.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun commandIs(commandClass: Class<*>): Boolean

Whether the command is a commandClass, or a subtype of it: a command class, or a marker interface or sealed family several commands share. It compares the class, so a command's former names (CommandType.aliases) are the same command. A mounted command is authorized as it arrives and, when a transformer changed its type, again as the command it became: it is the one, then the other.

Link copied to clipboard
inline fun <reified C : Any> CommandAction.commandIs(): Boolean

Whether this action's command is a C, or a subtype of it (CommandAction.commandIs).

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String