Interface EventPublicationRegistry
- All Known Implementing Classes:
DefaultEventPublicationRegistry
public interface EventPublicationRegistry
A registry to capture event publications to
ApplicationListeners. Allows to register those publications, mark
them as completed and lookup incomplete publications.- Author:
- Oliver Drotbohm, Björn Kieling, Dmitry Belyaev
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCompletedPublicationsOlderThan(Duration duration) Deletes all completedTargetEventPublications that have been completed before the givenDuration.Returns allTargetEventPublications that have not been completed yet.findIncompletePublicationsOlderThan(Duration duration) Returns allTargetEventPublications that have not been completed yet and have been published before the given duration in relation to "now".voidmarkCompleted(Object event, PublicationTargetIdentifier targetIdentifier) Marks the publication for the given event andPublicationTargetIdentifieras completed.voidmarkFailed(Object event, PublicationTargetIdentifier targetIdentifier) Marks the publication for the given event andPublicationTargetIdentifieras failed.voidprocessIncompletePublications(Predicate<EventPublication> filter, Consumer<TargetEventPublication> consumer, Duration duration) Processes all incomplete event publications that have been published before the given duration in relation to "now" by applying the given filter passing all remaining instances to the givenConsumer.store(Object event, Stream<PublicationTargetIdentifier> listeners) StoresTargetEventPublications for the given event andApplicationListeners.
-
Method Details
-
store
Collection<TargetEventPublication> store(Object event, Stream<PublicationTargetIdentifier> listeners) StoresTargetEventPublications for the given event andApplicationListeners.- Parameters:
event- must not be null.listeners- must not be null.
-
findIncompletePublications
Collection<TargetEventPublication> findIncompletePublications()Returns allTargetEventPublications that have not been completed yet.- Returns:
- will never be null.
-
findIncompletePublicationsOlderThan
Returns allTargetEventPublications that have not been completed yet and have been published before the given duration in relation to "now".- Parameters:
duration- must not be null.- Returns:
- will never be null.
- Since:
- 1.1
-
markCompleted
Marks the publication for the given event andPublicationTargetIdentifieras completed.- Parameters:
event- must not be null.targetIdentifier- must not be null.
-
markFailed
Marks the publication for the given event andPublicationTargetIdentifieras failed.- Parameters:
event- must not be null.targetIdentifier- must not be null.- Since:
- 1.3
-
deleteCompletedPublicationsOlderThan
Deletes all completedTargetEventPublications that have been completed before the givenDuration.- Parameters:
duration- must not be null.
-
processIncompletePublications
void processIncompletePublications(Predicate<EventPublication> filter, Consumer<TargetEventPublication> consumer, @Nullable Duration duration) Processes all incomplete event publications that have been published before the given duration in relation to "now" by applying the given filter passing all remaining instances to the givenConsumer.- Parameters:
filter- must not be null.consumer- must not be null.duration- can be null.- Since:
- 1.3
-