TenantQueryApi

A NodeQueryApi that builds the reads of a subscription handler itself (tenant), which the node asks of every QueryApi it hands its handlers, and those of a caller acting in a target its entry admitted (of a target), which a service route's call asks of the QueryApi it reads through: a provider's side of the read API, not an entry point of an application, which reads as a caller (QueryApi.of) or as trusted code (NodeQueryApi.trusted).

The node's own API implements it, pinning the tenant of the commit as trusted code, and so does a test's QueryApi that must read as the node does (:test-query's memory queries). Any other QueryApi, a test's fake say, serves a handler as a caller of the commit's tenant with no owner, space or subject, the rest NodeQueryApi.trusted.

Functions

Link copied to clipboard
abstract fun of(caller: Caller, target: TargetScope): Queries

The queries of caller, acting in the target scope its entry admitted for it (a service route's call, whose Wow-Scope names it), and already in that target's tenant and scope: read as QueryApi.of reads caller, each read of a type held to the read side's one rule of a target, as a query route's is, so a type whose tenant is fixed refuses a target naming another (wow.query.malformed) instead of reading in the fixed one. That rule holds for the node's own models; a peer's model is read for caller with no target, which the peer's own rules decide (#7665).

Link copied to clipboard
abstract fun tenant(tenantId: String): SubscriptionQueries

The queries of a subscription handler of a commit of tenantId, which its context hands it: they read in tenantId alone, and answer SubscriptionQueries.tenantId with it.