public interface SubjectStatusEvent
Represents an event that is raised when there is a change in the status of a subject.
A SubjectStatusEvent 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 a
subject. For example, if the back end system that feeds data to a
DataProvider goes down, the
DataProvider should raise a
SubjectStatusEvent 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.
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.
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getMessage()
Gets the subject status message.
|
SubjectStatus |
getStatus()
Gets the status of the subject.
|
java.lang.String |
getSubject()
Gets the subject that this
SubjectStatusEvent relates to. |
java.lang.String getSubject()
SubjectStatusEvent relates to.SubjectStatus getStatus()
java.lang.String getMessage()
Please send bug reports and comments to Caplin support