Interface TargetEventPublication
- All Superinterfaces:
Completable
,EventPublication
- All Known Implementing Classes:
DefaultEventPublication
An event publication.
- Author:
- Oliver Drotbohm, Björn Kieling, Dmitry Belyaev
-
Method Summary
Modifier and TypeMethodDescriptionReturns the identifier of the target that the event is supposed to be published to.default boolean
isAssociatedWith
(Object event, PublicationTargetIdentifier identifier) Returns whether theTargetEventPublication
is associated with the given event andPublicationTargetIdentifier
.default boolean
isIdentifiedBy
(PublicationTargetIdentifier identifier) Returns whether the publication is identified by the givenPublicationTargetIdentifier
.static TargetEventPublication
of
(Object event, PublicationTargetIdentifier id) Creates aTargetEventPublication
for the given event an listener identifier using a defaultInstant
.static TargetEventPublication
of
(Object event, PublicationTargetIdentifier id, Instant publicationDate) Creates aTargetEventPublication
for the given event an listener identifier and publication date.Methods inherited from interface org.springframework.modulith.events.core.Completable
markCompleted
Methods inherited from interface org.springframework.modulith.events.EventPublication
compareTo, getApplicationEvent, getCompletionDate, getEvent, getIdentifier, getPublicationDate, isCompleted, isPublicationCompleted
-
Method Details
-
of
Creates aTargetEventPublication
for the given event an listener identifier using a defaultInstant
. Prefer usingof(Object, PublicationTargetIdentifier, Instant)
with a dedicatedInstant
obtained 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 aTargetEventPublication
for 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 theTargetEventPublication
is associated with the given event andPublicationTargetIdentifier
.- Parameters:
event
- must not be null.identifier
- must not be null.- Since:
- 1.3
-