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<io.eventuate.common.id.Int128> snapshotVersion,
java.util.List<EventWithMetadata> oldEvents,
java.util.List<Event> newEvents)
Possibly generate a snapshot
|
Aggregate |
recreateAggregate(java.lang.Class<?> clasz,
Snapshot snapshot,
MissingApplyEventMethodStrategy missingApplyEventMethodStrategy)
Recreate an aggregate from a snapshot
|
java.lang.Class<?> getAggregateClass()
java.util.Optional<Snapshot> possiblySnapshot(Aggregate aggregate, java.util.Optional<io.eventuate.common.id.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 commandAggregate recreateAggregate(java.lang.Class<?> clasz, Snapshot snapshot, MissingApplyEventMethodStrategy missingApplyEventMethodStrategy)
clasz
- the aggregate classsnapshot
- the snapshotmissingApplyEventMethodStrategy
-