History

interface History<out T> : EventLog

A History is a high-performance log of serialized events, which aggregate the events into a current value which is incrementally computed from the linear sequence of events.

Parameters

T

the type of the aggregate.

Types

Link copied to clipboard
fun interface OnValueUpdateListener<in T>

A listener which may be used to observe some changes on the current value.

Functions

Link copied to clipboard
abstract fun acknowledged(): EventIdentifierArray

Returns an EventIdentifierArray with all the acknowledgements that have been issued by this MutableEventLog. This EventIdentifierArray only contains one EventIdentifier per SiteIdentifier.

Link copied to clipboard
open operator fun contains(id: EventIdentifier): Boolean

Returns true if the event with the event with the given EventIdentifier is included in the EventLog, or if any event with the same SiteIdentifier and a higher SequenceNumber has already been integrated.

abstract fun contains(seqno: SequenceNumber, site: SiteIdentifier): Boolean

Returns true if the event with the event with the given SiteIdentifier is included in the EventLog, or if any event with the same SiteIdentifier and a higher SequenceNumber has already been integrated.

Link copied to clipboard
abstract operator fun iterator(): EventIterator

Returns an EventIterator. The retrieved EventIterator will start at the beginning of the EventLog, and should not be used anymore if the underlying EventLog is modified.

abstract fun iterator(site: SiteIdentifier): EventIterator

Returns an EventIterator specific to a single site. The retrieved EventIterator will start at the beginning of the EventLog, and should not be used anymore if the underlying EventLog is modified.

Link copied to clipboard
abstract fun iteratorAtEnd(): EventIterator

Returns an EventIterator. The retrieved EventIterator will start at the end of the EventLog, and should not be used anymore if the underlying EventLog is modified.

abstract fun iteratorAtEnd(site: SiteIdentifier): EventIterator

Returns an EventIterator specific to a single site. The retrieved EventIterator will start at the end of the EventLog, and should not be used anymore if the underlying EventLog is modified.

Link copied to clipboard
abstract fun registerLogUpdateListener(listener: EventLog.OnLogUpdateListener)

Registers the provided OnLogUpdateListener to this EventLog.

Link copied to clipboard
abstract fun registerValueUpdateListener(listener: History.OnValueUpdateListener<T>)

Registers the provided OnValueUpdateListener to this History.

Link copied to clipboard
abstract fun unregisterLogUpdateListener(listener: EventLog.OnLogUpdateListener)

Unregisters the provided OnLogUpdateListener from this EventLog.

Link copied to clipboard
abstract fun unregisterValueUpdateListener(listener: History.OnValueUpdateListener<T>)

Unregisters the provided OnValueUpdateListener to this History.

Properties

Link copied to clipboard
abstract val current: T

The current value of the aggregated History.

Link copied to clipboard
abstract val size: Int

Returns the count of events in the EventLog.

Inheritors

Link copied to clipboard