CommandRequest
One command a CommandClient sends, and how: the command object, the aggregate it goes to, the scope it acts in and what the sender waits for.
command: the command object, sent as it is (not a Command, whose identity the client gives it).
aggregateId: the aggregate's id; null when the command names no aggregate id: a creation, whose id the server assigns, or an
@Unaddressedcommand, whose transformer finds its aggregate. The command's model on the server decides which, never the client.type: the aggregate type; null to derive it from the command's class, from the models of the service's own contexts and the contracts of its peers. A class no aggregate known to the client decides, or several decide, fails when it is sent, as does a lifecycle command (
DeleteAggregate, ...), which every aggregate takes:DeleteAggregate().toCommandRequest(id) { type(ShopContract.Cart.TYPE) }.targetScope: the tenant and the scope a cross-scope caller acts in (
Wow-Scope): its tenant, else the caller's, and its scope, else the caller's own (TargetScope.scope null; a saga's command keeps the commit's), on every path alike. It is the only source of the tenant and scope: a target tenant that is the caller's own changes nothing.wait (
Wow-Wait; the server's default plan when null) within timeout when given (Wow-Wait-Timeout).requestId, which makes the command idempotent (
Wow-Request-Id). When null, each send takes a new one, which the client's own retries keep; a request sent again by the application is then another request. For an application-level retry, set requestId (or keep the one the first result reports) and send that request again.expectedVersion of the aggregate (
If-Match; 0 for one never written).
Build it with toCommandRequest (PayOrder(amount).toCommandRequest(orderId) { wait(WaitPlan.COMMITTED) }), which the entries that take a command build it with (context.call(command, id) { ... }, client.wait(command, id)), or with of, builder or to; the constructor is internal to Wow. Fields may be added.
Constructors
Types
Builds a CommandRequest, one setter per field; build checks it as the constructor does. It is also the receiver of the block of toCommandRequest and of the entries that take a command, with the same names.
Properties
Functions
A builder of this request, to change some of its fields: the others, requestId included, are kept.