Interface EventPublicationRepository
- All Known Implementing Classes:
JdbcEventPublicationRepository,JdbcEventPublicationRepositoryV2,JpaEventPublicationRepository,MongoDbEventPublicationRepository,Neo4jEventPublicationRepository
public interface EventPublicationRepository
Repository to store
TargetEventPublications.- Author:
- Björn Kieling, Dmitry Belyaev, Oliver Drotbohm
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault intcountByStatus(EventPublication.Status status) Returns the number ofEventPublications for the given status.create(TargetEventPublication publication) Persists the givenTargetEventPublication.voidDeletes all publications that were already marked as completed.voiddeleteCompletedPublicationsBefore(Instant instant) Deletes all publication that were already marked as completed with a completion date before the given one.voiddeletePublications(List<UUID> identifiers) Deletes all publications with the given identifiers.default List<TargetEventPublication>findByStatus(EventPublication.Status status) Returns allTargetEventPublications with the givenEventPublication.Status.default List<TargetEventPublication>Returns all completed event publications currently found in the system.default List<TargetEventPublication>Returns allTargetEventPublications that have not been completed yet.findIncompletePublicationsByEventAndTargetIdentifier(Object event, PublicationTargetIdentifier targetIdentifier) Return the incompleteTargetEventPublicationfor the given serialized event and listener identifier.Returns allTargetEventPublications that have not been completed and were published before the givenInstant.voidmarkCompleted(Object event, PublicationTargetIdentifier identifier, Instant completionDate) Marks the publication for the given event andPublicationTargetIdentifierto be completed at the givenInstant.voidmarkCompleted(UUID identifier, Instant completionDate) Marks the publication with the given identifier completed at the givenInstant.default voidmarkCompleted(TargetEventPublication publication, Instant completionDate) Marks the givenTargetEventPublicationas completed.default voidmarkFailed(UUID identifier) Marks theEventPublicationwith the given identifier as failed.default voidmarkProcessing(UUID identifier) Marks theEventPublicationwith the given identifier as processing.default booleanmarkResubmitted(UUID identifier, Instant resubmissionDate) Marks theEventPublicationwith the given identifier as resubmitted.
-
Method Details
-
create
Persists the givenTargetEventPublication.- Parameters:
publication- must not be null.- Returns:
- will never be null.
-
markProcessing
Marks theEventPublicationwith the given identifier as processing.- Parameters:
identifier- must not be null.- Since:
- 2.0
- See Also:
-
markCompleted
Marks the givenTargetEventPublicationas completed.- Parameters:
publication- must not be null.completionDate- must not be null.
-
markCompleted
Marks the publication for the given event andPublicationTargetIdentifierto be completed at the givenInstant.- Parameters:
event- must not be null.identifier- must not be null.completionDate- must not be null.- See Also:
-
markCompleted
Marks the publication with the given identifier completed at the givenInstant.- Parameters:
identifier- must not be null.completionDate- must not be null.- Since:
- 1.3
- See Also:
-
markFailed
Marks theEventPublicationwith the given identifier as failed.- Parameters:
identifier- must not be null.- Since:
- 2.0
- See Also:
-
markResubmitted
Marks theEventPublicationwith the given identifier as resubmitted. Returns false in case the update was not successful, which usually means that the instance identified might have been claimed for re-submission by another application instance.- Parameters:
identifier- must not be null.resubmissionDate- must not be null.- Returns:
- whether the
EventPublicationwith the given identifier was marked as resubmitted. - Since:
- 2.0
- See Also:
-
findIncompletePublications
List<TargetEventPublication> findIncompletePublications()Returns allTargetEventPublications that have not been completed yet.- Returns:
- will never be null.
-
findIncompletePublicationsPublishedBefore
Returns allTargetEventPublications that have not been completed and were published before the givenInstant.- Parameters:
instant- must not be null.- Returns:
- will never be null.
- Since:
- 1.1
-
findIncompletePublicationsByEventAndTargetIdentifier
Optional<TargetEventPublication> findIncompletePublicationsByEventAndTargetIdentifier(Object event, PublicationTargetIdentifier targetIdentifier) Return the incompleteTargetEventPublicationfor the given serialized event and listener identifier.- Parameters:
event- must not be null.targetIdentifier- must not be null.- Returns:
- will never be null.
-
findCompletedPublications
Returns all completed event publications currently found in the system.- Returns:
- will never be null.
- Since:
- 1.1.2
-
deletePublications
Deletes all publications with the given identifiers.- Parameters:
identifiers- must not be null.- Since:
- 1.1
-
deleteCompletedPublications
void deleteCompletedPublications()Deletes all publications that were already marked as completed. -
deleteCompletedPublicationsBefore
Deletes all publication that were already marked as completed with a completion date before the given one.- Parameters:
instant- must not be null.
-
findFailedPublications
default List<TargetEventPublication> findFailedPublications(EventPublicationRepository.FailedCriteria criteria) - Parameters:
criteria- must not be null.- Returns:
- will never be null.
- Since:
- 2.0
-
findByStatus
Returns allTargetEventPublications with the givenEventPublication.Status.- Parameters:
status- must not be null.- Returns:
- will never be null.
- Since:
- 2.0
-
countByStatus
Returns the number ofEventPublications for the given status.- Parameters:
status- must not be null.- Returns:
- must not be negative
- Since:
- 2.0
-