Interface AddNewAggregateSnapshotStrategy
- All Known Implementing Classes:
AddNewAggregateSnapshotStrategy.AddNewSnapshotWhenBehindByNumberOfEvents
public interface AddNewAggregateSnapshotStrategy
Strategy for when an aggregate snapshot should be added
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescription<ID,AGGREGATE_IMPL_TYPE>
booleanshouldANewAggregateSnapshotBeAdded(AGGREGATE_IMPL_TYPE aggregate, AggregateEventStream<ID> persistedEvents, Optional<EventOrder> mostRecentlyStoredSnapshotLastIncludedEventOrder) Should a new aggregate snapshot be added based onupdateWhenBehindByNumberOfEvents(long numberOfEvents)
-
Method Details
-
updateWhenBehindByNumberOfEvents
-
updateOnEachAggregateUpdate
-
shouldANewAggregateSnapshotBeAdded
<ID,AGGREGATE_IMPL_TYPE> boolean shouldANewAggregateSnapshotBeAdded(AGGREGATE_IMPL_TYPE aggregate, AggregateEventStream<ID> persistedEvents, Optional<EventOrder> mostRecentlyStoredSnapshotLastIncludedEventOrder) Should a new aggregate snapshot be added based on- Parameters:
aggregate- the aggregate that was just updatedpersistedEvents- the events that was just persisted in relation to the aggregatemostRecentlyStoredSnapshotLastIncludedEventOrder- The most recent foundAggregateSnapshot.eventOrderOfLastIncludedEventfor the given Aggregate instance (may beOptional.empty())- Returns:
- true if the aggregate snapshot should be added, otherwise false
-