HttpQueries

class HttpQueries @InternalWowApi constructor(snapshots: Collection<QueryGateway> = emptyList(), events: Collection<QueryGateway> = emptyList(), val defaultListSize: Int = DEFAULT_LIST_SIZE, val datasets: DatasetQueryGateways = DatasetQueryGateways.NONE, val datasetVisibility: DatasetVisibility = DatasetVisibility.DEFAULT, val snapshotStatus: SnapshotStatus = SnapshotStatus.NONE, policies: Collection<QueryGateway> = emptyList(), val reads: ReadFacade? = null, val streams: QueryStreams = QueryStreams(), val crossTenant: Boolean = false, val access: AccessPolicies = AccessPolicies.NONE)

The query models the public routes serve, by aggregate type: the snapshots of each aggregate a snapshot query backend serves, and the events of each aggregate an events backend serves, every one a QueryGateway on the one engine. A model of the Manifest without one here has no route: a request for it is the context's 404.

The datasets are served under /wow/dataset/{context}/{dataset}/query, each by its gateway as it is when the request comes: a dataset that joins or leaves while the node runs is served or not from then on. datasetVisibility decides which of them a caller sees, in GET /wow/dataset and on its routes.

defaultListSize is the limit a list query that names none runs with over HTTP (a limit below 1 is refused as the body is read), at most the HTTP budget's maxListSize; 0 gives no default, so such a query reads every match where the budget allows it.

snapshotStatus tells whether an aggregate type's snapshots are being rebuilt or backfilled: its snapshot query and descriptor then answer with Wow-Rebuilding: true.

policies are the gateways that admit the states of each aggregate type whose snapshots are not queried while query policies may hide one (me.ahoo.wow.query.state.SnapshotPolicyGateway); no route serves them, and a state read sees a state as visibility says. reads is the read path of the state reads (ReadFacade), the QueryEngine's when it comes from one (of). streams is how a list streams as server-sent events.

access are the access policies of the aggregates that have one, whose state reads check no owner or space of their own: the policy decides them (AccessPolicies.governs).

crossTenant is whether a caller that may act across scopes may query across tenants (wow.query.allow-cross-tenant, off by default): Wow-Scope: tenant=* or tenant=("t1" "t2") on a query route, answered 403 wow.auth.forbidden while it is off.

Constructors

Link copied to clipboard
constructor(snapshots: Collection<QueryGateway> = emptyList(), events: Collection<QueryGateway> = emptyList(), defaultListSize: Int = DEFAULT_LIST_SIZE, datasets: DatasetQueryGateways = DatasetQueryGateways.NONE, datasetVisibility: DatasetVisibility = DatasetVisibility.DEFAULT, snapshotStatus: SnapshotStatus = SnapshotStatus.NONE, policies: Collection<QueryGateway> = emptyList(), reads: ReadFacade? = null, streams: QueryStreams = QueryStreams(), crossTenant: Boolean = false, access: AccessPolicies = AccessPolicies.NONE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

The events query gateway of type, or null when no backend serves its events.

Link copied to clipboard

The gateway of type's query model ({model} of its route), or null when none serves it.

Link copied to clipboard

The snapshot query gateway of type, or null when no backend serves its snapshots.

Link copied to clipboard

The gateway whose policies decide which of type's states a caller sees (me.ahoo.wow.query.state.StateVisibility): its snapshot query gateway, else its snapshot policy gateway; null when no policy applies to it.