Interface TargetEventPublication
- All Superinterfaces:
Completable,EventPublication
- All Known Implementing Classes:
DefaultEventPublication
An event publication.
- Author:
- Oliver Drotbohm, Björn Kieling, Dmitry Belyaev
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.modulith.events.EventPublication
EventPublication.Status -
Method Summary
Modifier and TypeMethodDescriptionReturns the identifier of the target that the event is supposed to be published to.default booleanisAssociatedWith(Object event, PublicationTargetIdentifier identifier) Returns whether theTargetEventPublicationis associated with the given event instance andPublicationTargetIdentifier.default booleanisIdentifiedBy(PublicationTargetIdentifier identifier) Returns whether the publication is identified by the givenPublicationTargetIdentifier.static TargetEventPublicationof(Object event, PublicationTargetIdentifier id) Creates aTargetEventPublicationfor the given event an listener identifier using a defaultInstant.static TargetEventPublicationof(Object event, PublicationTargetIdentifier id, Instant publicationDate) Creates aTargetEventPublicationfor the given event an listener identifier and publication date.Methods inherited from interface org.springframework.modulith.events.core.Completable
markCompletedMethods inherited from interface org.springframework.modulith.events.EventPublication
compareTo, getApplicationEvent, getCompletionAttempts, getCompletionDate, getEvent, getIdentifier, getLastResubmissionDate, getPublicationDate, getStatus, isCompleted, isPublicationCompleted
-
Method Details
-
of
Creates aTargetEventPublicationfor the given event an listener identifier using a defaultInstant. Prefer usingof(Object, PublicationTargetIdentifier, Instant)with a dedicatedInstantobtained from aClock.- Parameters:
event- must not be null.id- must not be null.- Returns:
- will never be null.
- See Also:
-
of
static TargetEventPublication of(Object event, PublicationTargetIdentifier id, Instant publicationDate) Creates aTargetEventPublicationfor the given event an listener identifier and publication date.- Parameters:
event- must not be null.id- must not be null.publicationDate- must not be null.- Returns:
- will never be null.
-
getTargetIdentifier
PublicationTargetIdentifier getTargetIdentifier()Returns the identifier of the target that the event is supposed to be published to.- Returns:
-
isIdentifiedBy
Returns whether the publication is identified by the givenPublicationTargetIdentifier.- Parameters:
identifier- must not be null.
-
isAssociatedWith
Returns whether theTargetEventPublicationis associated with the given event instance andPublicationTargetIdentifier.- Parameters:
event- must not be null.identifier- must not be null.- Since:
- 1.3
-