Package net.sf.eBus.feed.historic
historic publish feed
and
historic subscribe feed.
Historic Publish Feed
LikeIEPublishFeed, this feed posts live notification
messages to eBus if there are any live subscribers listening.
The value-added difference is that the historic publish feed
persists notifications using the configured
IEMessageStore instance.
Likewise, the historic publish feed also opens and advertises
a request feed for
historic request messages.
When an historic request is received, the historic
notification feed uses
IEMessageStore.retrieve(EInterval) method to extract
the historic notification messages which are sent back via
historic reply messages.
Objects needing to use an historic notification feed must
implement
IEHistoricPublisher
interface. Unlike an EPublisher which should not post
notification messages when there are no active subscribers,
an historic publisher is clear to post notifications on an
open, advertised, and up publish status historic feed because
of the need to persist messages.
Historic Subscribe Feed
Thisfeed
retrieve both historic and live notification
messages and present them as a single continuous stream back
to the
IEHistoricSubscriber.
These notification messages are ordered by timestamp
(millisecond granularity), publisher identifier, and message
position. For this reason it is important that historic
publishers be assigned a unique identifier and that messages
be assigned a unique position (especially if messages are
posted at a sub-millisecond rate).
Unless the historic subscribe feed is configured to accept
notification messages indefinitely, the historic subscriber is
informed that the underlying feed has terminated when
IEHistoricSubscriber.feedDone() method is called. Once
called, this means that the historic subscriber will no longer
receive updates.
Another difference between historic and live feeds is that
historic subscriber is informed of individual publisher feed
status via its
feedStatus
method. This allows the historic subscriber to determine if
there was or is a break in an individual publisher's stream.
The feedStatus() method is called for both past and
live publisher status updates.
-
Interface Summary Interface Description HistoricFeedDoneCallback An eBus client implementingIEHistoricSubscribermay choose to implement this functional interface as aprivatemethod instead of implementing thepublicIEHistoricSubscriber.feedDone(EHistoricSubscribeFeed.HistoricFeedState, EHistoricSubscribeFeed)method.HistoricFeedStatusCallback An eBus client implementingIEHistoricSubscribermay choose to implement this functional interface as aprivatemethod instead of implementing thepublicIEHistoricSubscriber.feedStatus(PublishStatusEvent, EHistoricSubscribeFeed)method.HistoricNotifyCallback An eBus client implementingIEHistoricSubscribermay choose to implement this functional interface as aprivatemethod instead of implementing thepublicIEHistoricSubscriber.notify(ENotificationMessage, EHistoricSubscribeFeed)method.HistoricPublishStatusCallback An eBus client implementingIEHistoricPublishermay choose to implement this functional interface as aprivatemethod instead of implementing thepublicIEHistoricPublisher.publishStatus(EFeedState, EHistoricPublishFeed)method.IEHistoricPublisher Classes wanting to send eBus notifications using anEHistoricPublishFeedneed to implement this interface.IEHistoricSubscriber Classes wanting to receive historic notifications from anhistoric subscribe feedneed to implement this interface.IEMessageStore This interface providesEHistoricPublishFeedthe ability to persist notification messages and to retrieve those message for a given historic time interval. -
Class Summary Class Description EAbstractHistoricFeed<T extends EObject> Base class forEHistoricPublishFeedandEHistoricSubscribeFeedcontaining the data members common to each.EAbstractHistoricFeed.Builder<T extends EObject,F extends EAbstractHistoricFeed<T>,B extends EAbstractHistoricFeed.Builder<T,F,?>> Base class forEHistoricPublishFeed.BuilderandEHistoricSubscribeFeed.Buildersubclasses.EHistoricPublishFeed The historic publisher feed extendsEPublishFeed's ability to publish notification messages to subscribers with the ability to: persist notification messages to aIEMessageStoreimplementation and handlehistoric notification requestsretrieving previously published messages from message store.EHistoricPublishFeed.Builder Builder is used to instantiateEHistoricPublishFeedinstances.EHistoricSubscribeFeed The historic subscriber feed extendsIESubscribeFeed's ability to receive live notification messages with the ability to seamlessly retrieve past notification messages fromhistoric publishers.EHistoricSubscribeFeed.Builder Builder is used to instantiateEHistoricSubscribeFeedinstances.EHistoricSubscribeFeed.PastComparator Comparator used to sort historic notification messages by timestamp, publisher identifier, and message position.HistoricReply This reply message contains one or more historic notification message in response to anhistoric notification request.HistoricReply.Builder Builder class forHistoricReplymessage instances.HistoricRequest Request for historic notification messages based on the given date/time interval.HistoricRequest.Builder Builder class forHistoricRequestmessage instances.PublishStatusEvent Notification event used to report and persist publish feed status updates.PublishStatusEvent.Builder Builder class forPublishStatusEventmessage instances. -
Enum Summary Enum Description EHistoricSubscribeFeed.HistoricFeedState Enumerates historic subscribe feed states.EHistoricSubscribeFeed.TimeLocation Denotes if a timestamp denotes the past, current time, future, or future on-going.