AccessStamping

class AccessStamping(context: String, models: Collection<AggregateModel<*>>, kernel: Kernel, stampsOf: (AggregateType) -> AccessStamps?, options: AccessStampOptions = AccessStampOptions(), val walking: AccessWalking? = null, observer: Observer = Observer.NONE, time: TimeSource = TimeSource.Monotonic)

The built-in subscription NAME of one bounded context: it keeps the access attributes of each aggregate's history its current ones. The kernel stamps each commit with the attributes after it (AccessValues.ofStream); when a commit changed them (its attributes differ from those of the stream before it), this subscription stamps them over every earlier stream of the aggregate (AccessStamps.stamp), as of the commit's version, in stamps of at most AccessStampOptions.batch streams. So an events query authorizes an aggregate's whole history by what it is now, within the subscription's lag.

  • Every type: the built-in owner and space are among the attributes, and any aggregate's scope can be transferred, so it follows every type of the context, from the beginning of the log.

  • The stream before: the attributes this subscription last saw of the aggregate, when that was the stream right before (AccessStampOptions.capacity aggregates remembered), else the stream before as the log holds it. In either case it holds the attributes as of its version or later ones a stamp gave it, so a commit that changed nothing stamps nothing.

  • Idempotent: a stamp writes only the streams not stamped as of a later version, so a replay, a retry or two owners of a partition at once leave each stream with its aggregate's latest attributes. A stream before that carries none (appended by a node of an earlier version, or imported) is stamped with the rest.

  • Whatever the schema: the attributes are compared as stored, so a commit of a node of another access schema (a rolling deployment) is followed as any: history follows the aggregate's latest stream, and the walk of the new schema (AccessWalking) derives them anew once its claim moves.

  • A stream without attributes: one not stamped is the walk's when the walk's heads reach it (walking's AccessWalking.covers); after them (a node of an earlier version still running, an import), the follower stamps its aggregate's whole history with the attributes of its current state (AccessWalking.stampCurrent), once, and passes over its streams up to that version.

  • Run as FunctionKind.PROJECT: it writes derived data of the log, as a projection does. A kind of its own would be a new value of an enum the wire carries (the OpenAPI document, the TypeScript client) for one built-in.

Constructors

Link copied to clipboard
constructor(context: String, models: Collection<AggregateModel<*>>, kernel: Kernel, stampsOf: (AggregateType) -> AccessStamps?, options: AccessStampOptions = AccessStampOptions(), walking: AccessWalking? = null, observer: Observer = Observer.NONE, time: TimeSource = TimeSource.Monotonic)

Types

Link copied to clipboard

Properties

Link copied to clipboard

The subscription to register: of every aggregate type of the context, from the beginning of the log.

Link copied to clipboard

The context's walks, which stamp the streams without attributes; none: such a stream stays as it is.

Functions

Link copied to clipboard
open override fun toString(): String