StateLockingRepository<C, S, V, CM, SM> class abstract interface

Stores and retrieves aggregate state with optimistic locking.

The repository returns the version of fetched state. Saves can use that version to reject updates when the stored state changed concurrently.

  • C: command type
  • S: state type
  • V: version type
  • CM: command metadata type
  • SM: state metadata type
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetchState(C command) Future<(S?, V?)>
Returns the state associated with command and its current version.
fetchStateWithMetadata(C command) Future<(S?, V?, SM)>
Returns the state, current version, and metadata for command.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(S state, V? currentStateVersion) Future<(S, V)>
Persists state if currentStateVersion still matches storage.
saveWithMetadata(S state, V? currentStateVersion, CM metadata) Future<(S, V, SM)>
Persists state with metadata if the version still matches storage.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited