AggregateManifest

class AggregateManifest @InternalWowApi constructor(val name: String, val description: String? = null, val state: StateManifest, val snapshot: SnapshotManifest = SnapshotManifest(), val commands: List<CommandManifest> = emptyList(), val events: List<EventManifest> = emptyList(), val queries: List<QueryManifest> = emptyList(), val schedules: List<String>? = null, val ownership: Ownership = Ownership.OWNER, val retired: List<String> = emptyList(), val idSource: AggregateIdSource = AggregateIdSource.ASSIGNED, val access: List<AccessAttributeManifest> = emptyList())

An aggregate of a context. Its commands are those it decides, those mounted under its routes, and its system commands: the lifecycle commands its model handles and the rebuild of its snapshots, named by their full names in the system namespace (wow.lifecycle.DeleteAggregate, wow.snapshot.Rebuild). Those are the same types for every aggregate, so they are not names within the aggregate and never conflict between aggregates; the body of each is the schema of Manifest.defs keyed by that full name (Manifest.schemaRef of it), so a client types it like a command's. queries are the read models of the aggregate a client queries (QueryManifest).

schedules names the commands the aggregate's decide functions may schedule, each by its full type name (context.aggregate.Command), as their @OnCommand(schedules) declare; null when none declares any.

ownership is who the aggregate belongs to besides its tenant, as @AggregateRoot(ownership) declares it: query admission restricts an owner-level caller's queries of an Ownership.OWNER aggregate to its owner, and not those of an Ownership.TENANT one.

idSource is where the aggregate's id comes from, as @AggregateRoot(idSource) declares it: an AggregateIdSource.OWNER aggregate's id is its owner's, so every command also has a route that names no id and means the caller's own aggregate (CommandRoutes), as its state read does, and no route generates an id.

retired lists the events the aggregate retired, as @AggregateRoot(retiredEvents) declares them: the stored names whose records are skipped, as EventManifest.aliases writes names (without a dot within the aggregate, else full). The compatibility gate takes an event removed and retired for a retirement, and the data migration checks a mapping to a retired name against it.

access lists the aggregate's access attributes, as its state's @Access members declare them, in declaration order: the facts its access policies compare with a caller's claims. The built-in ones, owner and space, are every aggregate's and not listed. The compatibility gate takes one removed, renamed or retyped for a break.

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

Constructors

Link copied to clipboard
constructor(name: String, description: String? = null, state: StateManifest, snapshot: SnapshotManifest = SnapshotManifest(), commands: List<CommandManifest> = emptyList(), events: List<EventManifest> = emptyList(), queries: List<QueryManifest> = emptyList(), schedules: List<String>? = null, ownership: Ownership = Ownership.OWNER, retired: List<String> = emptyList(), idSource: AggregateIdSource = AggregateIdSource.ASSIGNED, access: List<AccessAttributeManifest> = emptyList())

Properties

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

The commands of the domain: those the aggregate decides or mounts, its system commands left out.

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

The full names of the lifecycle commands the aggregate's model handles, among its system commands.

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 AggregateManifest.copyWith(name: String = this.name, description: String? = this.description, state: StateManifest = this.state, snapshot: SnapshotManifest = this.snapshot, commands: List<CommandManifest> = this.commands, events: List<EventManifest> = this.events, queries: List<QueryManifest> = this.queries, schedules: List<String>? = this.schedules, ownership: Ownership = this.ownership, retired: List<String> = this.retired, idSource: AggregateIdSource = this.idSource, access: List<AccessAttributeManifest> = this.access): AggregateManifest
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