Package-level declarations

Types

Link copied to clipboard

A loaded aggregate that handles commands against its current committedState. State changes only after accepted events have been committed to the event store.

Link copied to clipboard
data class AggregateCachePolicy(val maximumEntries: Int, val aggregateMutexStripes: Int = 1024, val confirmUnwritten: Boolean = false)

Bounds retained aggregates across independent LRU shards. Eviction is local to each shard, so uneven key distribution can leave some of the total capacity unused.

Link copied to clipboard
sealed interface AggregateChangeResult<out STATE : AggregateState, out EVENT>

Expected outcomes of handling a command. Unexpected programming or infrastructure failures are thrown rather than represented here.

Link copied to clipboard

Domain-owned definition shared by aggregate services and derived-state tooling.

Link copied to clipboard

Explicit command-idempotency opt-in for an aggregate definition.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Result of recovering a previously prepared append.

Link copied to clipboard

Creates and reconstructs aggregates from event history, optionally using snapshots to accelerate loading.

Link copied to clipboard

Application-facing entry point for aggregate command handling, lookup, and append recovery.

Link copied to clipboard
class AggregateServiceCaching<STATE : AggregateState, COMMAND, EVENT>(aggregateStore: AggregateRepository<STATE, COMMAND, EVENT>, cachePolicy: AggregateCachePolicy, aggregateMutexStripes: Int = cachePolicy.aggregateMutexStripes, cacheMutexStripes: Int = 16) : AggregateService<STATE, COMMAND, EVENT>

AggregateService that retains loaded aggregate instances in memory between commands.

Link copied to clipboard

AggregateService that reconstructs the aggregate for every command and lookup.

Link copied to clipboard

Domain state reconstructed solely by folding committed aggregate events.

Link copied to clipboard

State evolution details needed by tooling that does not handle commands.

Link copied to clipboard

Read-oriented view with a one-to-one identity relationship to an aggregate.

Link copied to clipboard
Link copied to clipboard
data class CommandEnvelope<out COMMAND>(val command: COMMAND, val aggregateId: String, val commandId: CommandId, val correlationId: CorrelationId? = null, val causedBy: EventReference? = null, val idempotency: CommandIdempotency? = null, val occurredAt: Instant = Clock.System.now()) : HasAggregateId

A command and the framework context needed to handle it against an aggregate.

Link copied to clipboard
value class CommandId(val value: String)

Caller-owned identity for one command submission.

Link copied to clipboard
data class CommittedState<out STATE : AggregateState>(val state: STATE, val version: Long) : HasAggregateVersion

Aggregate state at a committed stream version.

Link copied to clipboard
value class CorrelationId(val value: String)

Optional caller-owned identity linking commands and events belonging to the same root action.

Link copied to clipboard
data class EventReference(val aggregateType: String, val aggregateId: String, val eventId: Uuid)

Reference to a committed event that directly caused a command.

Link copied to clipboard
interface HasAggregateId
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Expected outcomes of deciding and persisting an aggregate-creation command.

Functions

Link copied to clipboard

Returns committed state for either success branch, or null for every failure branch.