Class JdbcEventPublicationRepository

java.lang.Object
org.springframework.modulith.events.jdbc.JdbcEventPublicationRepository
All Implemented Interfaces:
Aware, BeanClassLoaderAware, org.springframework.modulith.events.core.EventPublicationRepository

class JdbcEventPublicationRepository extends Object implements org.springframework.modulith.events.core.EventPublicationRepository, BeanClassLoaderAware
JDBC-based repository to store TargetEventPublications.
Author:
Dmitry Belyaev, Björn Kieling, Oliver Drotbohm
  • Constructor Details

    • JdbcEventPublicationRepository

      public JdbcEventPublicationRepository(JdbcOperations operations, org.springframework.modulith.events.core.EventSerializer serializer, DatabaseType databaseType)
      Creates a new JdbcEventPublicationRepository for the given JdbcOperations, EventSerializer and DatabaseType.
      Parameters:
      operations - must not be null.
      serializer - must not be null.
      databaseType - must not be null.
  • Method Details

    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoader classLoader)
      Specified by:
      setBeanClassLoader in interface BeanClassLoaderAware
    • create

      @Transactional public org.springframework.modulith.events.core.TargetEventPublication create(org.springframework.modulith.events.core.TargetEventPublication publication)
      Specified by:
      create in interface org.springframework.modulith.events.core.EventPublicationRepository
    • markCompleted

      @Transactional public void markCompleted(Object event, org.springframework.modulith.events.core.PublicationTargetIdentifier identifier, Instant completionDate)
      Specified by:
      markCompleted in interface org.springframework.modulith.events.core.EventPublicationRepository
    • findIncompletePublicationsByEventAndTargetIdentifier

      @Transactional(readOnly=true) public Optional<org.springframework.modulith.events.core.TargetEventPublication> findIncompletePublicationsByEventAndTargetIdentifier(Object event, org.springframework.modulith.events.core.PublicationTargetIdentifier targetIdentifier)
      Specified by:
      findIncompletePublicationsByEventAndTargetIdentifier in interface org.springframework.modulith.events.core.EventPublicationRepository
    • findCompletedPublications

      public List<org.springframework.modulith.events.core.TargetEventPublication> findCompletedPublications()
      Specified by:
      findCompletedPublications in interface org.springframework.modulith.events.core.EventPublicationRepository
    • findIncompletePublications

      @Transactional(readOnly=true) public List<org.springframework.modulith.events.core.TargetEventPublication> findIncompletePublications()
      Specified by:
      findIncompletePublications in interface org.springframework.modulith.events.core.EventPublicationRepository
    • findIncompletePublicationsPublishedBefore

      public List<org.springframework.modulith.events.core.TargetEventPublication> findIncompletePublicationsPublishedBefore(Instant instant)
      Specified by:
      findIncompletePublicationsPublishedBefore in interface org.springframework.modulith.events.core.EventPublicationRepository
    • deletePublications

      public void deletePublications(List<UUID> identifiers)
      Specified by:
      deletePublications in interface org.springframework.modulith.events.core.EventPublicationRepository
    • deleteCompletedPublications

      public void deleteCompletedPublications()
      Specified by:
      deleteCompletedPublications in interface org.springframework.modulith.events.core.EventPublicationRepository
    • deleteCompletedPublicationsBefore

      public void deleteCompletedPublicationsBefore(Instant instant)
      Specified by:
      deleteCompletedPublicationsBefore in interface org.springframework.modulith.events.core.EventPublicationRepository