public interface SnapshotStrategy
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
getAggregateClass()
The aggregate class that this is a strategy for
|
Optional<Snapshot> |
possiblySnapshot(Aggregate aggregate,
Optional<Int128> snapshotVersion,
List<EventWithMetadata> oldEvents,
List<Event> newEvents)
Possibly generate a snapshot
|
Aggregate |
recreateAggregate(Class<?> clasz,
Snapshot snapshot,
MissingApplyEventMethodStrategy missingApplyEventMethodStrategy)
Recreate an aggregate from a snapshot
|
Class<?> getAggregateClass()
Optional<Snapshot> possiblySnapshot(Aggregate aggregate, Optional<Int128> snapshotVersion, List<EventWithMetadata> oldEvents, List<Event> newEvents)
aggregate - - the updated aggregatesnapshotVersion - - the version of the snapshot, if any, that the aggregate was created fromoldEvents - - the old events that were used to recreate the aggregatenewEvents - - the new events generated as a result of executing a commandAggregate recreateAggregate(Class<?> clasz, Snapshot snapshot, MissingApplyEventMethodStrategy missingApplyEventMethodStrategy)
clasz - the aggregate classsnapshot - the snapshotmissingApplyEventMethodStrategy - missing apply event method strategyCopyright © 2021. All rights reserved.