Package net.sf.eBus.feed.historic
Class HistoricReply
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject
-
- net.sf.eBus.messages.EMessage
-
- net.sf.eBus.messages.EReplyMessage
-
- net.sf.eBus.feed.historic.HistoricReply
-
- All Implemented Interfaces:
Serializable
public final class HistoricReply extends EReplyMessage implements Serializable
This reply message contains one or more historic notification message in response to anhistoric notification request. These notifications are in publish order for a given publisher identifier. If there are further notifications to be returned thenreply statusis set toEReplyMessage.ReplyStatus.OK_CONTINUING; if the notification playback is completed, then reply status is set toEReplyMessage.ReplyStatus.OK_FINAL. If an error occurs processing the historic notification request, thenEReplyMessageis sent in reply withEReplyMessage.ReplyStatus.ERRORandEReplyMessage.replyReasonexplaining the error.An example historic notification reply creation (note that replies may only be created using a
builderinstance.final HistoricReply.Builder builder = HistoricReply.builder(); final Collection<ENotificationMessage> notifications = ...; // Notifications sent in reply. final HistroricReply reply = builder.subject(mReplySubject) .timestamp(Instant.now()) .notifications(notifications) .build()This reply is generally used by
EHistoricPublishFeedto send historic notification messages back to requester.Note: the notification messages may contain
PublishStatusEventalong with the published notification messages. This allows the requester to determine when a publisher's feed is down, meaning that the notification stream may be missing messages.- Author:
- Charles W. Rapp
- See Also:
HistoricRequest,EHistoricPublishFeed,EHistoricSubscribeFeed, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHistoricReply.BuilderBuilder class forHistoricReplymessage instances.-
Nested classes/interfaces inherited from class net.sf.eBus.messages.EReplyMessage
EReplyMessage.ConcreteBuilder, EReplyMessage.ReplyStatus
-
Nested classes/interfaces inherited from class net.sf.eBus.messages.EMessage
EMessage.MessageType
-
-
Field Summary
Fields Modifier and Type Field Description ENotificationMessage[]notificationsOne of more historic notification messages.-
Fields inherited from class net.sf.eBus.messages.EReplyMessage
replyReason, replyStatus
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HistoricReply.Builderbuilder()Returns new historic reply message builder instance.StringtoString()Returns textual representation of historic notification reply.-
Methods inherited from class net.sf.eBus.messages.EReplyMessage
equals, hashCode, isFinal
-
Methods inherited from class net.sf.eBus.messages.EMessage
isApplicationMessage, isSystemMessage, key, messageType
-
-
-
-
Field Detail
-
notifications
public final ENotificationMessage[] notifications
One of more historic notification messages. Will not be an empty array.
-
-
Method Detail
-
toString
public String toString()
Returns textual representation of historic notification reply. Reports number of notifications in reply but not the notification messages themselves.- Overrides:
toStringin classEReplyMessage- Returns:
- historic notification reply as text.
-
builder
public static HistoricReply.Builder builder()
Returns new historic reply message builder instance. It is not recommended to re-use a builder instance to create more than one historic reply.- Returns:
- new historic reply message builder instance.
-
-