Package-level declarations
Types
How a client calls a peer, and as whom:
A command's result as a peer answers it, read by the one reader the client reads every answer with.
Where a client finds the service of a context: the base URL of its Port, such as http://ordering:8080. Wow keeps no registry and balances no load: a resolver that picks an instance per call (from a service registry, DNS or a sidecar) is the application's, and is asked again on every attempt, so a retry may reach another instance.
The credential headers of the request a coroutine serves, which UserCredential.FORWARDED forwards: the host's edge puts them in the context of the request's handler, so code that calls a peer while serving the request calls it as the request's end user.
The synchronous calls of a node's sagas to the HTTP command gateways of other contexts: the service mode of the command client (ClientMode.Service), at the base URL endpoints gives each context's internal port (wow.peers.<context>.url), the only one that takes a call; its public port refuses Wow-Call. Each call goes to the command's route as the contracts list it (CommandIndex.routeOf), those of the peers' api jars on the class path by default, as the HttpCommandClient sends one (a command whose body names its aggregate to its route without an id), and carries:
The CommandClient of the peers' HTTP command routes: each command goes, as JSON, to the route its contract gives it (POST /{context}/{aggregate}/{id}/{command}, or without the id for a request that names none: a creation, an unaddressed command, or any command of an aggregate whose id is its owner's, which goes to the caller's own; and for a command whose body names its aggregate, whose body names the request's, as CommandBodies writes it), named by names from its class and the request's type (the one whose contract lists the class when the request leaves it out), on the port transport's mode calls, as caller:
The QueryApi of the peers' HTTP read routes: the same queries as in process, sent as JSON ({"kind": "list", ...}) to the query route of each model, POST /{context}/{aggregate}/{model}/query, the dataset route POST /wow/dataset/{context}/{dataset}/query, and the state read GET /{context}/{aggregate}/{id}/state, on the port transport's mode calls, as the caller of gives:
A command named by its type rather than by its class: a command to a peer described by its Manifest alone (wow.peers.<context>.contract: manifest), which a console, a gateway or a tool calls without the peer's api jar. type is its full type name, context.aggregate.Command (the aggregate's type and the command's name in the peer's Manifest, or one of its aliases), and body its JSON, sent as is.
The peer contexts the service reaches over HTTP (routing moved here from the host): each context of modes by the client of its mode, service or user. Every context of modes must be a peer the contracts on the class path declare (contracts), not one of the service's own, unless it is one of described, the peers described by their Manifest alone (contract: manifest), which no contract on the class path may declare.
How a peer context is reached over HTTP: SERVICE, on its internal port as this service, asserting the caller as the root of the call (ClientMode.Service); USER, on its public routes, forwarding the end user's credential (ClientMode.User).
A problem a peer answered with (RFC 9457): its HTTP status, its Wow code (none for one that is only HTTP's, or a body that is no problem, such as a proxy's), its detail, the command's result when it had a ref, what a retry may do and after how long (retryAfter, its Retry-After), and the aggregate's version it answered: a rejection's, or the current one a state read of a minimum version was answered with (wow.query.min-version-not-reached). A failure the client's transport met itself (no node reached, a connection lost) is one too, of a catalog code, with that failure as its cause.
Reads problems as a Wow server writes them: what a retry may do is the problem's retry member, which every problem carries (the error catalog's for its code when it lacks one), its wait the Retry-After it came with, else the catalog's. A body that is no Wow problem (a proxy's, a gateway's) may be retried when it is a 503 or a 429, with the same request id.
How often a client sends a request again that a peer answered with a problem a retry may get past, each time after the Retry-After the peer answered with, else after backoff doubled at each attempt:
The service's CommandClient: a command to an aggregate of a peer context peers reach goes over HTTP, any other through local, the node's gateway (in process, or a peer's command topic). A request without a type goes to the one aggregatesOf (the node's models and the contracts on the class path) gives its command's class, a NamedCommand's to the one its type names.
The service's NodeQueryApi: the models of a peer context peers reach over HTTP, any other in process through local; a state class of none of the node's models (localStates) is a peer's, found by its contract. Trusted queries are in process alone: a peer reads for a caller.
The credential a client forwards in user mode: the request headers that make the peer's public port authenticate the end user a call acts for, its caller, as its own edge did (Authorization, and CoSec's CoSec-App-Id when the application is part of what it authorizes). The peer decides the caller's identity, tenant and scope from them alone: a client asserts nothing.
The typed clients of the peers' HTTP routes, all on one JDK HttpClient and one EndpointResolver, in one ClientMode: commands sends command objects as the location-transparent CommandClient does in process, and queries reads their snapshots, events, datasets and states as the QueryApi does. A peer's commands and state classes are found in the contract its api jar carries, read from the class path: a consumer depends on the peer's *-api and writes no path.