ServerCommandRequest

class ServerCommandRequest @InternalWowApi constructor(val context: String, val aggregate: String, val command: String, val body: CommandBody, val caller: Caller = Caller.ANONYMOUS, val aggregateId: String? = null, val target: TargetScope? = null, val requestId: String? = null, val expectedVersion: Int? = null, val headers: Map<String, String> = emptyMap(), val wait: WaitPlan? = null, val trace: Map<String, String> = emptyMap(), val call: CallContext? = null, val tenantId: String? = null)

The server side of a CommandRequest: what the gateway receives from any client, the HTTP edge, the Kafka intake or the in-process client, before admission. What the route fixed (context, aggregate, command and, on an instance route, aggregateId), the undecoded body, who sent it (caller), and the facts the request's headers gave: a cross-scope target (Wow-Scope), a requestId (Wow-Request-Id), an expectedVersion (If-Match), the request facts in headers, and the wait plan (Wow-Wait; the default plan when absent).

command is the command type's model name (or a former name, @Alias), or the part of it after the aggregate type (AddItem for shop.cart.AddItem). A request built from a command object (of with a CommandBody.Value and an AggregateRef) names its command by the object's class name, and admission derives the command type from the class: from the models of the node for a context it serves, from the contract of a peer context. Identity is not taken from anywhere else: not from headers (a header named Wow-… or wow.… is reserved and refused) and never from the body. tenantId is the tenant the request's ref names: admission decides the tenant as always (the caller's, a cross-scope target's or the one fixed for the type) and refuses a request whose ref names another.

trace holds the trace context the request arrived with, such as the W3C traceparent and tracestate headers: delivery metadata, never a fact, which only an observer reads.

call is the root command a service identity's synchronous call acts for (the Wow-Call header): admission takes it only from a caller that is a service identity.

Fields may be added: construct a request with of or builder; the constructor is internal to Wow.

Constructors

Link copied to clipboard
constructor(context: String, aggregate: String, command: String, body: CommandBody, caller: Caller = Caller.ANONYMOUS, aggregateId: String? = null, target: TargetScope? = null, requestId: String? = null, expectedVersion: Int? = null, headers: Map<String, String> = emptyMap(), wait: WaitPlan? = null, trace: Map<String, String> = emptyMap(), call: CallContext? = null, tenantId: String? = null)

Types

Link copied to clipboard
class Builder

Builds a ServerCommandRequest from what of takes and any of the request's facts, each setter replacing the fact it names; build checks the request. A fact added to the request later comes with a setter of its own.

Link copied to clipboard
object Companion

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
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun copyWith(context: String = this.context, aggregate: String = this.aggregate, command: String = this.command, body: CommandBody = this.body, caller: Caller = this.caller, aggregateId: String? = this.aggregateId, target: TargetScope? = this.target, requestId: String? = this.requestId, expectedVersion: Int? = this.expectedVersion, headers: Map<String, String> = this.headers, wait: WaitPlan? = this.wait, trace: Map<String, String> = this.trace, call: CallContext? = this.call, tenantId: String? = this.tenantId): ServerCommandRequest

This ServerCommandRequest with the given fields replaced: Wow's own copy, left out of the ABI.

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