AccessStamps

The stamps of a store that keeps an aggregate's history with its access attributes (AccessValues): a log, or an index of its streams. A stamp writes the aggregate's current attributes over its earlier streams, so that a query of its history authorizes each stream by what the aggregate is now.

Each stream keeps the version its attributes are of, its stamp: its own version when it is appended with them, the version of the commit that changed them when a stamp wrote them. A stamp as of a version writes only the streams that are not stamped, or stamped as of that version or an earlier one. So stamps of different versions, in any order and as many times as a retry or a replay repeats them, leave each stream with the latest one's attributes, and a stamp of the same version writes them again, as a new model derives them.

Inheritors

Types

Link copied to clipboard

Functions

Link copied to clipboard
abstract suspend fun stamp(ref: AggregateRef, access: Map<String, Any?>, asOf: Int, from: Int, until: Int): Int

Writes access, the attributes of ref as of its version asOf, over its streams of the versions from from until until (exclusive) that are not stamped or are stamped as of asOf or earlier; returns how many it wrote. A version the store does not hold is passed over.

Link copied to clipboard
open suspend fun stampAll(stamps: List<AccessStamp>): Int

Writes each of stamps as stamp writes it, in as few writes as the store makes of them: the access walk's stamps of a page of aggregates. Returns how many streams they wrote. Each is one stamp: stamp one at a time, unless the store writes them together.