RequestIdentity

The identity of one request to one aggregate's route: each fact (tenant, owner, aggregate ID, space, request ID) read where the route states it, by the same rules as the built-in command and query handlers (see RouteIdentityBinding), header aliases included. A custom handler reads identity through it, with ServerRequest.identity.

Creating it rejects a blank identity path variable the route declares (400), before any fact is read, so a blank segment is reported as such whatever else the request contradicts. A header contradicting a tenant or owner the path fixes is rejected (400) when that fact is read.

Properties

Link copied to clipboard
val request: ServerRequest

Functions

Link copied to clipboard

The aggregate ID: from the owner when the owner is the aggregate ID, else {id}, else Command-Aggregate-Id.

Link copied to clipboard
fun ownerId(body: String? = null): String?

The owner: {ownerId}, else {id} when the owner is the aggregate ID, else Command-Owner-Id. A non-null body is only checked against an owner the route fixes.

Link copied to clipboard

The owner a read filters by: ownerId, except that an owner derived from {id} is not a filter.

Link copied to clipboard

The request ID: Command-Request-Id or a request ID alias; a blank header counts as absent.

Link copied to clipboard
fun spaceId(): String?

The space: Wow-Space-Id (or a space alias) when the aggregate is spaced, otherwise null.

Link copied to clipboard
fun tenantId(body: String? = null): String?

The tenant: the aggregate's static tenant, else {tenantId}, else Command-Tenant-Id. A non-null body (the command body's tenant) is only checked: it may not contradict a tenant the route fixes.