StateEventRecord

class StateEventRecord @InternalWowApi constructor(val ref: AggregateRef, val version: Int, val commandId: String, val requestId: String, val commandType: String, val commitTime: Long, val events: List<StateEventPayload>, val state: PublishedState? = null, val scope: Scope = Scope.NONE, val deleted: Boolean = false, val access: Map<String, Any?>? = null, val causation: Causation? = null, val headers: Map<String, String> = emptyMap(), val operator: Operator? = null, val transport: Transport? = null, val imported: Boolean = false, val accessVersion: Int? = if (access == null) null else version)

The published unit of a context: one committed event stream of an aggregate with the aggregate's state after it, what the Kafka Sink writes to the aggregate type's topic and what another context's subscription reads. It lives in :spi because the backends that write or read it depend on :spi only.

  • ref and version identify the commit; id (ref@version) is what a reader deduplicates by (publishing is at least once).

  • commandId, requestId, commandType, commitTime, scope, causation, headers and operator are the stream's facts; events are its events at their current revision.

  • state is the aggregate's state after the stream; null when the sink publishes the aggregate type without it (PublishedManifest.includeState). deleted is the aggregate's after the stream, as the kernel evolved it, and access its access attributes, the built-in owner and space among them, in their stored form (me.ahoo.wow.spi.access.AccessValues): the stream's, which a stamp keeps current; null when the stream has none and the state is not at hand. Both are published either way, access with accessVersion, the version it is of (the stream's own by default; a later one's when a stamp wrote them), null with it.

  • transport is the stream's transport metadata: the wait context and the trace. It is not a fact: the envelope carries it beside the record (me.ahoo.wow.spi.transport.Envelope.transport), never inside it.

  • imported marks a commit migrate-data imported from 9.x, at or before the context's cut-over (me.ahoo.wow.spi.subscription.ImportCutover): 9.x already acted on it, so a peer's saga or reactor passes over it, while a projection or a sink takes it. False for every commit a V10 service made.

Fields may be added: construct one with of; the constructor is internal to Wow.

Constructors

Link copied to clipboard
constructor(ref: AggregateRef, version: Int, commandId: String, requestId: String, commandType: String, commitTime: Long, events: List<StateEventPayload>, state: PublishedState? = null, scope: Scope = Scope.NONE, deleted: Boolean = false, access: Map<String, Any?>? = null, causation: Causation? = null, headers: Map<String, String> = emptyMap(), operator: Operator? = null, transport: Transport? = null, imported: Boolean = false, accessVersion: Int? = if (access == null) null else version)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val access: Map<String, Any?>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: String

The identity of the commit, ref@version: what a reader deduplicates by.

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

Functions

Link copied to clipboard
fun copyWith(ref: AggregateRef = this.ref, version: Int = this.version, commandId: String = this.commandId, requestId: String = this.requestId, commandType: String = this.commandType, commitTime: Long = this.commitTime, events: List<StateEventPayload> = this.events, state: PublishedState? = this.state, scope: Scope = this.scope, deleted: Boolean = this.deleted, access: Map<String, Any?>? = this.access, causation: Causation? = this.causation, headers: Map<String, String> = this.headers, operator: Operator? = this.operator, transport: Transport? = this.transport, imported: Boolean = this.imported, accessVersion: Int? = this.accessVersion): StateEventRecord

This StateEventRecord with the given fields replaced: Wow's own copy, left out of the ABI.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String