Package-level declarations

Types

Link copied to clipboard
class DefaultQueryGateway(val aggregateType: AggregateType, backend: QueryBackend, schemaProvider: QueryModelSchemaProvider, filters: List<QueryFilter> = emptyList(), policies: List<QueryPolicy> = emptyList(), observer: QueryObserver = QueryObserver.NONE, val entryPolicy: QueryEntryPolicy = QueryEntryPolicy.DEFAULT, counts: QueryCountCache? = null, records: QueryRecordReader? = null, constraints: List<ConstraintDescriptor> = emptyList(), model: QueryModel = QueryModel.SNAPSHOT, authorizer: ReadAuthorizer = ReadAuthorizer.ALLOW_ALL) : QueryGateway

The QueryGateway over one backend: schemaProvider supplies the schema every query is admitted against, filters and policies run at admission steps 1 and 2, and observer sees every outcome. One instance serves every caller.

Link copied to clipboard
class QueryCaller @InternalWowApi constructor(val caller: Caller? = null, val entry: QueryEntry = QueryEntry.UNSPECIFIED, val selection: FilterExpression = MatchAllFilter, val scope: QueryScope = QueryScope.NONE, val crossTenant: CrossTenant? = null, val target: TargetScope? = null)

Who runs a query, and how: the explicit argument of every gateway operation and of QueryPolicy, in place of 9.x's Reactor ContextView. The identity is the Caller commands are admitted with: the HTTP edge resolves one per request and, for a Wow-Scope request, has QueryTargets decide the tenant and scope it acts in; the query adds only its execution context. In-process code passes IN_PROCESS.

Link copied to clipboard
enum class QueryEntry : Enum<QueryEntry>

Where a query came from; its QueryCaller states it.

Link copied to clipboard
interface QueryGateway

The queries of one aggregate type's read model, each run for an explicit QueryCaller: admitted (QueryAdmission), executed on the backend's four primitives (BackendQueries.kt) within the timeout the caller's budget gives, and observed. Records are JSON trees as the model stores them; a caller that wants a type reads them with WowJson.

Link copied to clipboard

How a gateway reads the records its backend returns, in place of the schema's response masks: a model whose records the backend returns as stored and the gateway reads as the model shows them (the events model). The record is the backend's own, fresh instance; the reader may change it in place and return it.

Link copied to clipboard
class QueryScope @InternalWowApi constructor(val authenticated: FilterExpression = MatchAllFilter, val declared: FilterExpression = MatchAllFilter)

The caller's scope, split by provenance. Both halves restrict the query; only the authenticated half counts as provided when a gateway requires an authenticated scope.