CommandManifest

class CommandManifest @InternalWowApi constructor(val name: String, val aliases: List<String> = emptyList(), val schema: String, val creation: Creation = Creation.NONE, val produces: List<String>? = null, val routes: List<RouteManifest> = emptyList(), val mounted: Boolean = false, val transformsTo: List<String>? = null, val description: String? = null, val system: Boolean = false, val idProperty: String? = null, val internal: Boolean = false)

A command the aggregate decides, or one mounted under its routes.

aliases are former names, as @Alias declares them: one without a dot is within the aggregate, one with dots a full type name. produces names the events of the aggregate the command's decide function and after hooks can produce, as their signatures say or @OnCommand(produces) declares; null when neither says (a Decision, Any). routes are the command's REST routes (CommandRoutes).

A mounted command (@MountedCommand) is decided by no aggregate: a transformer of the service turns it into a command that is, at admission. It creates nothing itself (creation is Creation.NONE) and produces nothing (produces is null); transformsTo lists, by full type name, the commands it becomes, as @MountedCommand(transformsTo) declares them; null when it declares none.

description is what the command's class says it does: its @Description, else the summary of its KDoc; null when it says nothing. It documents the command for a client, and is no part of the contract.

idProperty is the property of the command's JSON body that holds the id of the aggregate it acts on, as its class's @AggregateId property declares it; null for a command whose request names the aggregate. Such a command's routes name no id: a sender reads it from the body, and one that cannot (a computed id it does not send) leaves it to the service, which reads it from the command.

A system command is the framework's, not the domain's: a lifecycle command, a snapshot rebuild or a schedule job's command, named by its full system name (wow.lifecycle.DeleteAggregate) and routed on a reserved segment (CommandRoutes.SYSTEM_SEGMENT_PREFIX). Every route the edge serves is a command's routes, a system command's included, so a client routes from the Manifest alone.

An internal command (@InternalCommand) is sent by the platform alone: the service's own sagas, schedules and in-process gateway, and other services on its internal port. Its routes are written as any command's, and the internal port serves them; the public port does not, and its OpenAPI document and the generated clients leave the command out. A system command is never internal.

Fields may be added: pass the constructor's arguments by name.

Constructors

Link copied to clipboard
constructor(name: String, aliases: List<String> = emptyList(), schema: String, creation: Creation = Creation.NONE, produces: List<String>? = null, routes: List<RouteManifest> = emptyList(), mounted: Boolean = false, transformsTo: List<String>? = null, description: String? = null, system: Boolean = false, idProperty: String? = null, internal: Boolean = false)

Properties

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

Functions

Link copied to clipboard
fun CommandManifest.copyWith(name: String = this.name, aliases: List<String> = this.aliases, schema: String = this.schema, creation: Creation = this.creation, produces: List<String>? = this.produces, routes: List<RouteManifest> = this.routes, mounted: Boolean = this.mounted, transformsTo: List<String>? = this.transformsTo, description: String? = this.description, system: Boolean = this.system, idProperty: String? = this.idProperty, internal: Boolean = this.internal): CommandManifest
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