Interface StatusEvent
- All Known Subinterfaces:
SubjectStatusEvent
Usage in DataSource source applications
A StatusEvent can be raised by a source application (that is, a DataSource application sending data
to its DataSource peers). A DataProvider in the application creates the
SubjectStatusEvent to indicate to peers the status of their subscription to all subjects. For example,
if the back end system that feeds data to a DataProvider goes down, the
DataProvider should raise a StatusEvent with a with a
SubjectStatus of SubjectStatus.Stale to indicate to the peer that the data it has is not completely
up-to-date. When an update is subsequently received from the backend data feed, then the
DataProvider should raise a SubjectStatusEvent with a
SubjectStatus of SubjectStatus.Ok to indicate to the peer that the data it has is now up to date.
Usage in DataSource sink applications
A SubjectStatusEvent can be received by a sink application (that is, a DataSource application
receiving data from its DataSource peers). Such events are received through the
SubscriptionListener.subjectStatusReceived(com.caplin.datasource.subscription.Subscription, Peer, SubjectStatusEvent) callback on SubscriptionListener.
You do not have to implement this interface yourself. Instances can be created by calling the
MessageFactory.createSubjectStatusEvent(String, SubjectStatus, String) method
on the MessageFactory that is available on the
Publisher interface.
-
Method Summary
Modifier and TypeMethodDescriptionGets the subject status message.Gets the status of the subject.
-
Method Details
-
getStatus
SubjectStatus getStatus()Gets the status of the subject.- Returns:
- The status.
-
getMessage
String getMessage()Gets the subject status message.- Returns:
- A string representing the subject status.
-