Interface AddNewAggregateSnapshotStrategy
-
- All Known Implementing Classes:
AddNewAggregateSnapshotStrategy.AddNewSnapshotWhenBehindByNumberOfEvents
public interface AddNewAggregateSnapshotStrategyStrategy for when an aggregate snapshot should be added
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAddNewAggregateSnapshotStrategy.AddNewSnapshotWhenBehindByNumberOfEvents
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <ID,AGGREGATE_IMPL_TYPE>
booleanshouldANewAggregateSnapshotBeAdded(AGGREGATE_IMPL_TYPE aggregate, dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.eventstream.AggregateEventStream<ID> persistedEvents, Optional<dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.types.EventOrder> mostRecentlyStoredSnapshotLastIncludedEventOrder)Should a new aggregate snapshot be added based onstatic AddNewAggregateSnapshotStrategyupdateOnEachAggregateUpdate()static AddNewAggregateSnapshotStrategyupdateWhenBehindByNumberOfEvents(long numberOfEvents)
-
-
-
Method Detail
-
updateWhenBehindByNumberOfEvents
static AddNewAggregateSnapshotStrategy updateWhenBehindByNumberOfEvents(long numberOfEvents)
-
updateOnEachAggregateUpdate
static AddNewAggregateSnapshotStrategy updateOnEachAggregateUpdate()
-
shouldANewAggregateSnapshotBeAdded
<ID,AGGREGATE_IMPL_TYPE> boolean shouldANewAggregateSnapshotBeAdded(AGGREGATE_IMPL_TYPE aggregate, dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.eventstream.AggregateEventStream<ID> persistedEvents, Optional<dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.types.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
-
-