Class AddNewAggregateSnapshotStrategy.AddNewSnapshotWhenBehindByNumberOfEvents
- java.lang.Object
-
- dk.cloudcreate.essentials.components.eventsourced.aggregates.snapshot.AddNewAggregateSnapshotStrategy.AddNewSnapshotWhenBehindByNumberOfEvents
-
- All Implemented Interfaces:
AddNewAggregateSnapshotStrategy
- Enclosing interface:
- AddNewAggregateSnapshotStrategy
public static class AddNewAggregateSnapshotStrategy.AddNewSnapshotWhenBehindByNumberOfEvents extends Object implements AddNewAggregateSnapshotStrategy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dk.cloudcreate.essentials.components.eventsourced.aggregates.snapshot.AddNewAggregateSnapshotStrategy
AddNewAggregateSnapshotStrategy.AddNewSnapshotWhenBehindByNumberOfEvents
-
-
Constructor Summary
Constructors Constructor Description AddNewSnapshotWhenBehindByNumberOfEvents(long numberOfEventsBetweenAddingANewSnapshot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)longgetNumberOfEventsBetweenAddingANewSnapshot()inthashCode()<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 onStringtoString()
-
-
-
Method Detail
-
getNumberOfEventsBetweenAddingANewSnapshot
public long getNumberOfEventsBetweenAddingANewSnapshot()
-
shouldANewAggregateSnapshotBeAdded
public <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)Description copied from interface:AddNewAggregateSnapshotStrategyShould a new aggregate snapshot be added based on- Specified by:
shouldANewAggregateSnapshotBeAddedin interfaceAddNewAggregateSnapshotStrategy- 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
-
-