Interface EventPublicationRepository
- All Known Implementing Classes:
JdbcEventPublicationRepository
,JpaEventPublicationRepository
,MongoDbEventPublicationRepository
public interface EventPublicationRepository
Repository to store
TargetEventPublication
s.- Author:
- Björn Kieling, Dmitry Belyaev, Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(TargetEventPublication publication) Persists the givenTargetEventPublication
.void
Deletes all publications that were already marked as completed.void
deleteCompletedPublicationsBefore
(Instant instant) Deletes all publication that were already marked as completed with a completion date before the given one.void
deletePublications
(List<UUID> identifiers) Deletes all publications with the given identifiers.Returns allTargetEventPublication
s that have not been completed yet.findIncompletePublicationsByEventAndTargetIdentifier
(Object event, PublicationTargetIdentifier targetIdentifier) Return the incompleteTargetEventPublication
for the given serialized event and listener identifier.Returns allTargetEventPublication
s that have not been completed and were published before the givenInstant
.void
markCompleted
(Object event, PublicationTargetIdentifier identifier, Instant completionDate) Marks the publication for the given event andPublicationTargetIdentifier
to be completed at the givenInstant
.default void
markCompleted
(TargetEventPublication publication, Instant completionDate) Marks the givenTargetEventPublication
as completed.
-
Method Details
-
create
Persists the givenTargetEventPublication
.- Parameters:
publication
- must not be null.- Returns:
- will never be null.
-
markCompleted
Marks the givenTargetEventPublication
as completed.- Parameters:
publication
- must not be null.completionDate
- must not be null.
-
markCompleted
Marks the publication for the given event andPublicationTargetIdentifier
to be completed at the givenInstant
.- Parameters:
event
- must not be null.identifier
- must not be null.completionDate
- must not be null.
-
findIncompletePublications
List<TargetEventPublication> findIncompletePublications()Returns allTargetEventPublication
s that have not been completed yet.- Returns:
- will never be null.
-
findIncompletePublicationsPublishedBefore
Returns allTargetEventPublication
s 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 incompleteTargetEventPublication
for the given serialized event and listener identifier.- Parameters:
event
- must not be null.targetIdentifier
- must not be null.- Returns:
- will never be null.
-
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.
-