SnapshotRepository

Repository for storing and retrieving snapshots of state aggregates. Snapshots optimize aggregate loading by providing a recent state checkpoint.

Inheritors

Properties

Link copied to clipboard
abstract val name: String

Functions

Link copied to clipboard
open fun getVersion(aggregateId: AggregateId): Mono<Int>

Gets the version of the latest snapshot for the specified aggregate. Returns UNINITIALIZED_VERSION if no snapshot exists.

Link copied to clipboard
abstract fun <S : Any> load(aggregateId: AggregateId): Mono<Snapshot<S>>

Loads the latest snapshot for the specified aggregate.

Link copied to clipboard

Wraps a SnapshotRepository with metrics collection capabilities. Returns a MetricSnapshotRepository that collects metrics on snapshot storage operations.

Link copied to clipboard
abstract fun <S : Any> save(snapshot: Snapshot<S>): Mono<Void>

Saves a snapshot to the repository.

Link copied to clipboard
abstract fun scanAggregateId(namedAggregate: NamedAggregate, afterId: String = FIRST_ID, limit: Int = 10): Flux<AggregateId>

Scans for aggregate IDs within the specified named aggregate, starting after the given ID. Returns a limited number of aggregate IDs in lexicographical order.