public interface SnapshotStrategy
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
getAggregateClass()
The aggregate class that this is a strategy for
|
java.util.Optional<Snapshot> |
possiblySnapshot(Aggregate aggregate,
java.util.Optional<Int128> snapshotVersion,
java.util.List<EventWithMetadata> oldEvents,
java.util.List<Event> newEvents)
Possibly generate a snapshot
|
Aggregate |
recreateAggregate(java.lang.Class<?> clasz,
Snapshot snapshot)
Recreate an aggregate from a snapshot
|
java.lang.Class<?> getAggregateClass()
java.util.Optional<Snapshot> possiblySnapshot(Aggregate aggregate, java.util.Optional<Int128> snapshotVersion, java.util.List<EventWithMetadata> oldEvents, java.util.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 command