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).
id: 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:CommandRequest.of(DeleteAggregate, id, type = ShopContract.Cart.TYPE).targetTenant and targetScope: the tenant and scope a cross-scope caller acts in (
Wow-Scope); the caller's own when unset. They are 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 of, builder or to; the constructor is internal to Wow. Fields may be added.
Constructors
Types
Properties
Functions
A builder of this request, to change some of its fields: the others, requestId included, are kept.