Interface AddNewAggregateSnapshotStrategy

    • Method Detail

      • 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 updated
        persistedEvents - the events that was just persisted in relation to the aggregate
        mostRecentlyStoredSnapshotLastIncludedEventOrder - The most recent found AggregateSnapshot.eventOrderOfLastIncludedEvent for the given Aggregate instance (may be Optional.empty())
        Returns:
        true if the aggregate snapshot should be added, otherwise false