Interface EventPublicationRepository

All Known Implementing Classes:
JdbcEventPublicationRepository, JpaEventPublicationRepository, MongoDbEventPublicationRepository

public interface EventPublicationRepository
Repository to store EventPublications.
Author:
Björn Kieling, Dmitry Belyaev, Oliver Drotbohm
  • Method Details

    • create

      EventPublication create(EventPublication publication)
      Persists the given EventPublication.
      Parameters:
      publication - must not be null.
      Returns:
      will never be null.
    • markCompleted

      default void markCompleted(EventPublication publication, Instant completionDate)
      Marks the given EventPublication as completed.
      Parameters:
      publication - must not be null.
      completionDate - must not be null.
    • markCompleted

      void markCompleted(Object event, PublicationTargetIdentifier identifier, Instant completionDate)
      Marks the publication for the given event and PublicationTargetIdentifier to be completed at the given Instant.
      Parameters:
      event - must not be null.
      identifier - must not be null.
      completionDate - must not be null.
    • findIncompletePublications

      List<EventPublication> findIncompletePublications()
      Returns all EventPublication that have not been completed yet.
      Returns:
      will never be null.
    • findIncompletePublicationsByEventAndTargetIdentifier

      Optional<EventPublication> findIncompletePublicationsByEventAndTargetIdentifier(Object event, PublicationTargetIdentifier targetIdentifier)
      Return the incomplete EventPublication for the given serialized event and listener identifier.
      Parameters:
      event - must not be null.
      targetIdentifier - must not be null.
      Returns:
      will never be null.
    • deleteCompletedPublications

      void deleteCompletedPublications()
      Deletes all publications that were already marked as completed.
    • deleteCompletedPublicationsBefore

      void deleteCompletedPublicationsBefore(Instant instant)
      Deletes all publication that were already marked as completed with a completion date before the given one.
      Parameters:
      instant - must not be null.