Class HistoricReply

  • All Implemented Interfaces:
    Serializable

    public final class HistoricReply
    extends EReplyMessage
    This reply message contains one or more historic notification message in response to an historic notification request. These notifications are in publish order for a given publisher identifier. If there are further notifications to be returned then reply status is set to EReplyMessage.ReplyStatus.OK_CONTINUING; if the notification playback is completed, then reply status is set to EReplyMessage.ReplyStatus.OK_FINAL. If an error occurs processing the historic notification request, then EReplyMessage is sent in reply with EReplyMessage.ReplyStatus.ERROR and EReplyMessage.replyReason explaining the error.

    An example historic notification reply creation (note that replies may only be created using a builder instance.

    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 EHistoricPublishFeed to send historic notification messages back to requester.

    Note: the notification messages may contain PublishStatusEvent along 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
    • 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:
        toString in class EReplyMessage
        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.