ReadOnlyStateAggregate

Read-only interface for state aggregates that support read operations only.

This interface represents a state aggregate that has been loaded from a snapshot or event store and is intended for read-only operations. It provides access to all aggregate state and metadata without supporting command processing or state modification.

Key characteristics:

  • Supports read operations for querying aggregate state

  • Provides access to version, timing, and operator information

  • Does not support command processing or event sourcing

  • Can be converted to a writable StateAggregate when needed

Implementations should ensure that:

  • State cannot be modified through this interface

  • All read operations return consistent, accurate data

  • Version information reflects the current aggregate state

Since

1.0.0

Parameters

S

The type of the state data held by this aggregate.

See also

for the writable counterpart

for state objects that can be aware of their read-only aggregate

Inheritors

Properties

Link copied to clipboard
abstract override val aggregateId: AggregateId

The unique identifier of this aggregate.

Link copied to clipboard
abstract val deleted: Boolean
Link copied to clipboard
abstract val eventId: String
Link copied to clipboard
abstract val eventTime: Long
Link copied to clipboard

The expected version for the next event to be applied.

Link copied to clipboard
abstract val firstEventTime: Long
Link copied to clipboard
abstract val firstOperator: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val operator: String
Link copied to clipboard
abstract val ownerId: String
Link copied to clipboard
abstract val spaceId: SpaceId
Link copied to clipboard
abstract val state: S
Link copied to clipboard
abstract override val version: Int

The current version of this aggregate's state.

Functions

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