Companion

object Companion

Functions

Link copied to clipboard
fun of(command: Any, ref: AggregateRef, caller: Caller = Caller.ANONYMOUS, aggregateId: String? = ref.id.takeIf { ref.isAssigned }, tenantId: String? = ref.tenantId, targetScope: TargetScope? = null, requestId: String? = null, expectedVersion: Int? = null, headers: Map<String, String> = emptyMap(), wait: WaitPlan? = null, trace: Map<String, String> = emptyMap()): ServerCommandRequest

A request for the command object command to the aggregate ref names, with the other facts of names: its context and aggregate are ref's type, its command type the one admission derives from command's class, its tenant ref's and its aggregate id ref's, none for an unassigned ref (a creation that leaves its id to admission). The object is not encoded: admission checks it as it is, and the command carries it, so it is not changed once sent.

fun of(context: String, aggregate: String, command: String, body: CommandBody, caller: Caller = Caller.ANONYMOUS, aggregateId: String? = null, tenantId: String? = null, targetScope: TargetScope? = null, requestId: String? = null, expectedVersion: Int? = null, headers: Map<String, String> = emptyMap(), wait: WaitPlan? = null, trace: Map<String, String> = emptyMap()): ServerCommandRequest

A request for command of aggregate in context with body, and any of the request's other facts, each named: who sends it (caller, anonymous by default), the aggregate it targets (aggregateId; none for a command that creates one with an id it is given), the tenant its ref names (tenantId, which must be the one admission decides; none to take that one), the scope a cross-scope caller acts in (targetScope, Wow-Scope), the request id that makes it idempotent (requestId, Wow-Request-Id; a new one by default), the version the caller believes the aggregate is at (expectedVersion, If-Match), the request facts admission may keep on the command (headers), what the caller waits for (wait, Wow-Wait; the default plan when none) and the trace context it arrived with (trace).