SimpleSnapshot

data class SimpleSnapshot<S : Any>(val delegate: ReadOnlyStateAggregate<S>, val snapshotTime: Long = System.currentTimeMillis()) : Snapshot<S> , ReadOnlyStateAggregate<S> , Decorator<ReadOnlyStateAggregate<S>>

Simple implementation of Snapshot that wraps a ReadOnlyStateAggregate with a snapshot time.

Parameters

delegate

the state aggregate being snapshotted

snapshotTime

the time when the snapshot was taken (default: current time)

Constructors

Link copied to clipboard
constructor(delegate: ReadOnlyStateAggregate<S>, snapshotTime: Long = System.currentTimeMillis())

Properties

Link copied to clipboard
open override val aggregateId: AggregateId

The unique identifier of this aggregate.

Link copied to clipboard
open override val delegate: ReadOnlyStateAggregate<S>
Link copied to clipboard
open override val deleted: Boolean
Link copied to clipboard
open override val eventId: String
Link copied to clipboard
open override val eventTime: Long
Link copied to clipboard
open override val expectedNextVersion: Int

The expected version for the next event to be applied.

Link copied to clipboard
open override val firstEventTime: Long
Link copied to clipboard
open override val firstOperator: String
Link copied to clipboard
open override val initialized: Boolean
Link copied to clipboard
open override val isInitialVersion: Boolean
Link copied to clipboard
open override val operator: String
Link copied to clipboard
open override val ownerId: String
Link copied to clipboard
open override val snapshotTime: Long
Link copied to clipboard
open override val spaceId: SpaceId
Link copied to clipboard
open override val state: S
Link copied to clipboard
open override val version: Int

The current version of this aggregate's state.

Functions

Link copied to clipboard
fun <S : Any, D : Any> Snapshot<S>.materialize(materialize: (S) -> D): MaterializedSnapshot<D>
Link copied to clipboard
fun AggregateIdCapable.toGroupKey(parallelism: Int = DEFAULT_PARALLELISM): Int

Computes a grouping key for parallel processing based on the aggregate ID.

Link copied to clipboard
Link copied to clipboard