Interface StatusEvent
-
- All Known Subinterfaces:
SubjectStatusEvent
public interface StatusEvent
Represents an event that is raised when there is a change in the status of the backend.
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). ADataProvider
in the application creates theSubjectStatusEvent
to indicate to peers the status of their subscription to all subjects. For example, if the back end system that feeds data to aDataProvider
goes down, theDataProvider
should raise aStatusEvent
with a with aSubjectStatus
ofSubjectStatus.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 theDataProvider
should raise aSubjectStatusEvent
with aSubjectStatus
ofSubjectStatus.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 theSubscriptionListener.subjectStatusReceived(com.caplin.datasource.subscription.Subscription, Peer, SubjectStatusEvent)
callback onSubscriptionListener
.You do not have to implement this interface yourself. Instances can be created by calling the
MessageFactory.createSubjectStatusEvent(String, SubjectStatus, String)
method on theMessageFactory
that is available on thePublisher
interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getMessage()
Gets the subject status message.SubjectStatus
getStatus()
Gets the status of the subject.
-
-
-
Method Detail
-
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.
-
-