Class DefaultEventPublication
java.lang.Object
org.springframework.modulith.events.core.DefaultEventPublication
- All Implemented Interfaces:
Completable,TargetEventPublication,EventPublication
Default
TargetEventPublication implementation.- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.modulith.events.EventPublication
EventPublication.Status -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventPublication(Object event, PublicationTargetIdentifier targetIdentifier, Instant publicationDate) Creates a newDefaultEventPublicationfor the given event andPublicationTargetIdentifier. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the number of completion attempts.Returns the completion date of the publication.getEvent()Returns the event that is published.Returns a unique identifier for this publication.@Nullable InstantReturns the last time theEventPublicationwas resubmitted.Returns the time the event is published at.Return the publication'sEventPublication.Status.Returns the identifier of the target that the event is supposed to be published to.inthashCode()voidmarkCompleted(Instant instant) Marks the instance as completed at the givenInstant.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.modulith.events.EventPublication
compareTo, getApplicationEvent, isCompleted, isPublicationCompletedMethods inherited from interface org.springframework.modulith.events.core.TargetEventPublication
isAssociatedWith, isIdentifiedBy
-
Constructor Details
-
DefaultEventPublication
DefaultEventPublication(Object event, PublicationTargetIdentifier targetIdentifier, Instant publicationDate) Creates a newDefaultEventPublicationfor the given event andPublicationTargetIdentifier.- Parameters:
event- must not be null.targetIdentifier- must not be null.publicationDate- must not be null.
-
-
Method Details
-
getIdentifier
Description copied from interface:EventPublicationReturns a unique identifier for this publication.- Specified by:
getIdentifierin interfaceEventPublication- Returns:
- will never be null.
-
getEvent
Description copied from interface:EventPublicationReturns the event that is published.- Specified by:
getEventin interfaceEventPublication- Returns:
- will never be null.
-
getTargetIdentifier
Description copied from interface:TargetEventPublicationReturns the identifier of the target that the event is supposed to be published to.- Specified by:
getTargetIdentifierin interfaceTargetEventPublication- Returns:
-
getPublicationDate
Description copied from interface:EventPublicationReturns the time the event is published at.- Specified by:
getPublicationDatein interfaceEventPublication- Returns:
- will never be null.
-
getCompletionDate
Description copied from interface:EventPublicationReturns the completion date of the publication.- Specified by:
getCompletionDatein interfaceEventPublication- Returns:
- will never be null.
-
markCompleted
Description copied from interface:CompletableMarks the instance as completed at the givenInstant.- Specified by:
markCompletedin interfaceCompletable- Parameters:
instant- must not be null.
-
getStatus
Description copied from interface:EventPublicationReturn the publication'sEventPublication.Status.- Specified by:
getStatusin interfaceEventPublication- Returns:
- will never be null.
-
getLastResubmissionDate
Description copied from interface:EventPublicationReturns the last time theEventPublicationwas resubmitted.- Specified by:
getLastResubmissionDatein interfaceEventPublication- Returns:
- can be null.
-
getCompletionAttempts
public int getCompletionAttempts()Description copied from interface:EventPublicationReturns the number of completion attempts.- Specified by:
getCompletionAttemptsin interfaceEventPublication
-
toString
-
equals
-
hashCode
public int hashCode()
-