ContractDirectory
The contracts a service knows: its own Manifest, local, and the peer contracts, peers (META-INF/wow/contract.json of each api jar on the class path, which the Gradle plugin packages from the context's domain module; load reads them), without the contexts local serves (PeerContracts.outside, DX gap G21: the service's own api is on its class path, and on a class path that several services share, another service's api carries no contract of this one). It answers, for any context of either:
whether a context is the service's own (isLocal), and its contract (contextOf, aggregateOf);
the stream a context publishes for an aggregate, with its topic and whether it carries the state (publishedOf);
the full type name of a command a Manifest refers to by its schema,
#/$defs/<binary name>, and back (commandTypeOf, schemaOf);the contexts the service's sagas call synchronously (contextsCalled);
the subscriptions of a context and their kinds (subscriptionOf); as a SubscriptionDirectory, it lets a wait chain name a subscription of another context, and over puts it behind the subscription runtime of the node's own context, which knows its subscriptions' progress.
Startup checks: building it fails with a ContractException listing every problem:
the peer contracts conflict (PeerContracts.conflicts): two of them declare one context;
a subscription of local reads another context (
@OnEvent(aggregates = ["ctx.agg"])) that no Manifest declares, an aggregate the context does not have, or one it does not publish;such a subscription reads events by type that the contract of that aggregate does not declare;
such a subscription reads a stream published without the state (
includeState = false) but its handler takes a state that is not nullable: its own Manifest source does not saynullableState, which the compiler records forStateEvent<S?>andStateEvent<*>. Each subscription answers for itself: another context's subscription of the same name says nothing of it.
A command a saga refers to (SubscriptionManifest.derives, SubscriptionManifest.rejected) is resolved (commandTypeOf) but not checked here: a lifecycle command is no context's, and whether a chain may follow a saga's hop into a context is the wait's check, from derivedContextsOf.
Properties
The names of the contexts local serves.
The names of the contexts the peers declare.
The peer contracts given, each without the contexts local serves, and without those left with none.
Functions
The contract of the aggregate type.
The aggregate types whose contract, the service's or a peer's, lists a command of the schema schema (#/$defs/<binary name>), a mounted one left out: where a saga sends a command of that class whose ref it leaves out. Empty when none does.
The commands the subscriptions of local send outside hosted, the contexts a node serves (DX gap G9): for each subscription (context/processor.function), the contexts of the commands its saga derives (SubscriptionManifest.derives), handles the receipts of (SubscriptionManifest.rejected, SubscriptionManifest.committed) or schedules (SubscriptionManifest.schedules) that hosted does not hold. Such a command goes through a command topic. A command referred to by a schema no Manifest decides is another context's too, named UNKNOWN_CONTEXT; a lifecycle command is no context's and is left out.
The full type name (ctx.agg.Command) of the command reference names: a schema reference (#/$defs/<binary name>) resolves to the command of that schema, in whichever context decides it; a full type name is itself when a context decides it. Null when no context of the service or its peers decides it.
The contract of context, this service's or a peer's.
The contexts the saga subscriptions of local call synchronously (SubscriptionManifest.calls), by subscription (context/processor.function): each command's context, or UNKNOWN_CONTEXT for a command no Manifest of the service or its peers decides. Unlike commandsOutside, a called command needs no command topic: the node calls its context's gateway.
Whether subscription of type's context handles the commits of type: the snapshot subscription when type keeps snapshots; another one when it reads its own context and names no aggregates or type's.
The contexts of the commands the saga subscription of context derives or calls, as its Manifest declares them (SubscriptionManifest.derives and SubscriptionManifest.calls): each command's own context, a schema reference resolved through the Manifest of the context that decides it (commandTypeOf). Null when the subscription declares no derives, or when one of them cannot be resolved: a wait chain after its hop is then not checked.
Whether a Manifest, the service's own or a peer's, declares context.
A Manifest says nothing of a subscription's progress (a hop of another context is not checked).
The property of the body of a command of commandType (ctx.agg.Command) that holds its aggregate's id, as its context's Manifest names it; null for one whose request names its aggregate.
The kind of subscription of context, as the context's Manifest lists it, or the built-in snapshot subscription (Hop.SNAPSHOT_SUBSCRIPTION) of a context with an aggregate that keeps snapshots. A saga's @OnRejected handler is not a wait's hop: its rejection ended the wait; an @OnCommitted handler is a saga's hop, which the receipts of the commands it answers signal.
This directory behind runtime, the subscription directory of the node's ownContext: a hop of it is answered by runtime, which knows the subscriptions the node runs and their progress; a hop of any other context, this service's or a peer's, by the Manifests.
The stream of type's state events its context publishes, with its topic and includeState; null if none.
The schema reference of the command type commandType (ctx.agg.Command), as its context's Manifest gives it.