Module spring.modulith.events.jpa
Class JpaEventPublicationRepository
java.lang.Object
org.springframework.modulith.events.jpa.JpaEventPublicationRepository
- All Implemented Interfaces:
org.springframework.modulith.events.core.EventPublicationRepository
@Transactional
@Repository
class JpaEventPublicationRepository
extends Object
implements org.springframework.modulith.events.core.EventPublicationRepository
Repository to store
TargetEventPublications.- Author:
- Oliver Drotbohm, Dmitry Belyaev, Björn Kieling, Cora Iberkleid
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.modulith.events.core.EventPublicationRepository
org.springframework.modulith.events.core.EventPublicationRepository.FailedCriteria -
Constructor Summary
ConstructorsConstructorDescriptionJpaEventPublicationRepository(jakarta.persistence.EntityManager entityManager, org.springframework.modulith.events.core.EventSerializer serializer, org.springframework.modulith.events.support.CompletionMode completionMode) -
Method Summary
Modifier and TypeMethodDescriptionintcountByStatus(org.springframework.modulith.events.EventPublication.Status status) org.springframework.modulith.events.core.TargetEventPublicationcreate(org.springframework.modulith.events.core.TargetEventPublication publication) voidvoiddeleteCompletedPublicationsBefore(Instant instant) voiddeletePublications(List<UUID> identifiers) List<org.springframework.modulith.events.core.TargetEventPublication>findByStatus(org.springframework.modulith.events.EventPublication.Status status) List<org.springframework.modulith.events.core.TargetEventPublication>List<org.springframework.modulith.events.core.TargetEventPublication>findFailedPublications(org.springframework.modulith.events.core.EventPublicationRepository.FailedCriteria criteria) List<org.springframework.modulith.events.core.TargetEventPublication>Optional<org.springframework.modulith.events.core.TargetEventPublication>findIncompletePublicationsByEventAndTargetIdentifier(Object event, org.springframework.modulith.events.core.PublicationTargetIdentifier targetIdentifier) List<org.springframework.modulith.events.core.TargetEventPublication>Class<? extends JpaEventPublication>Returns the type representing completed event publications.voidmarkCompleted(Object event, org.springframework.modulith.events.core.PublicationTargetIdentifier identifier, Instant completionDate) voidmarkCompleted(UUID identifier, Instant completionDate) voidmarkFailed(UUID identifier) voidmarkProcessing(UUID identifier) booleanmarkResubmitted(UUID identifier, Instant resubmissionDate) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.modulith.events.core.EventPublicationRepository
markCompleted
-
Constructor Details
-
JpaEventPublicationRepository
public JpaEventPublicationRepository(jakarta.persistence.EntityManager entityManager, org.springframework.modulith.events.core.EventSerializer serializer, org.springframework.modulith.events.support.CompletionMode completionMode) - Parameters:
entityManager- must not be null.serializer- must not be null.
-
-
Method Details
-
create
public org.springframework.modulith.events.core.TargetEventPublication create(org.springframework.modulith.events.core.TargetEventPublication publication) - Specified by:
createin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
markProcessing
- Specified by:
markProcessingin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
markCompleted
public void markCompleted(Object event, org.springframework.modulith.events.core.PublicationTargetIdentifier identifier, Instant completionDate) - Specified by:
markCompletedin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
markCompleted
- Specified by:
markCompletedin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
markFailed
- Specified by:
markFailedin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
markResubmitted
- Specified by:
markResubmittedin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
findIncompletePublications
@Transactional(readOnly=true) public List<org.springframework.modulith.events.core.TargetEventPublication> findIncompletePublications()- Specified by:
findIncompletePublicationsin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
findIncompletePublicationsPublishedBefore
@Transactional(readOnly=true) public List<org.springframework.modulith.events.core.TargetEventPublication> findIncompletePublicationsPublishedBefore(Instant instant) - Specified by:
findIncompletePublicationsPublishedBeforein interfaceorg.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:
findIncompletePublicationsByEventAndTargetIdentifierin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
findCompletedPublications
public List<org.springframework.modulith.events.core.TargetEventPublication> findCompletedPublications()- Specified by:
findCompletedPublicationsin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
findFailedPublications
public List<org.springframework.modulith.events.core.TargetEventPublication> findFailedPublications(org.springframework.modulith.events.core.EventPublicationRepository.FailedCriteria criteria) - Specified by:
findFailedPublicationsin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
deletePublications
- Specified by:
deletePublicationsin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
deleteCompletedPublications
public void deleteCompletedPublications()- Specified by:
deleteCompletedPublicationsin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
deleteCompletedPublicationsBefore
- Specified by:
deleteCompletedPublicationsBeforein interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
findByStatus
public List<org.springframework.modulith.events.core.TargetEventPublication> findByStatus(org.springframework.modulith.events.EventPublication.Status status) - Specified by:
findByStatusin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
countByStatus
public int countByStatus(org.springframework.modulith.events.EventPublication.Status status) - Specified by:
countByStatusin interfaceorg.springframework.modulith.events.core.EventPublicationRepository
-
getCompletedEntityType
Returns the type representing completed event publications.- Returns:
- will never be null.
- Since:
- 1.3
-