public interface SubscriptionListener
The SubscriptionListener
interface allows applications to receive events raised for
a Subscription
.
Implement this interface to receive subscription events. You must implement all the callback
methods; there is one for each subject type (Record, Page, News, and so on). Alternatively, you
can derive your SubscriptionListener implementation from the
BaseSubscriptionListener
class and then override the
methods corresponding to the subject types for which you want to handle events.
Note:: the SubscriptionListener
methods are not called on a dedicated worker
thread. Therefore, if any of these methods are likely take a relatively long time to execute,
they should be coded to run in a separate thread.
Modifier and Type | Method and Description |
---|---|
void |
containerUpdated(Subscription subscription,
Peer peer,
ContainerMessage message)
Called when a container update is received.
|
void |
genericMessageUpdated(Subscription subscription,
Peer peer,
GenericMessage message)
Called when an update to generic message data is received.
|
void |
newsUpdated(Subscription subscription,
Peer peer,
NewsMessage message)
Called when a news headline update is received.
|
void |
pageUpdated(Subscription subscription,
Peer peer,
PageMessage message)
Called when a page update is received.
|
void |
permissionUpdated(Subscription subscription,
Peer peer,
PermissionMessage message)
Called when when a permission update is received.
|
void |
recordType2Updated(Subscription subscription,
Peer peer,
RecordType2Message message)
Called when an update to type 2 data in a record is received.
|
void |
recordType3Updated(Subscription subscription,
Peer peer,
RecordType3Message message)
Called when an update to type 3 data in a record is received.
|
void |
recordUpdated(Subscription subscription,
Peer peer,
RecordMessage message)
Called when an update to type 1 data in a record is received.
|
void |
storyUpdated(Subscription subscription,
Peer peer,
StoryMessage message)
Called when a story update is received.
|
void |
subjectErrorReceived(Subscription subscription,
Peer peer,
SubjectErrorEvent subjectErrorEvent)
Called when there is an error in a subscription.
|
void |
subjectStatusReceived(Subscription subscription,
Peer peer,
SubjectStatusEvent subjectStatusEvent)
Called when there is a change in the status of a subscription.
|
void recordUpdated(Subscription subscription, Peer peer, RecordMessage message)
Called when an update to type 1 data in a record is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The record update.void recordType2Updated(Subscription subscription, Peer peer, RecordType2Message message)
Called when an update to type 2 data in a record is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The record update.void recordType3Updated(Subscription subscription, Peer peer, RecordType3Message message)
Called when an update to type 3 data in a record is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The record update.void genericMessageUpdated(Subscription subscription, Peer peer, GenericMessage message)
Called when an update to generic message data is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The record update.void permissionUpdated(Subscription subscription, Peer peer, PermissionMessage message)
Called when when a permission update is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The permission update.void newsUpdated(Subscription subscription, Peer peer, NewsMessage message)
Called when a news headline update is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The news update.void storyUpdated(Subscription subscription, Peer peer, StoryMessage message)
Called when a story update is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The story update.void containerUpdated(Subscription subscription, Peer peer, ContainerMessage message)
Called when a container update is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The container update.
The operations on the
ContainerMessage
are not
normalized; therefore the message may contain contradictory operations, for example
an add for an element followed by a delete for the same element.
void pageUpdated(Subscription subscription, Peer peer, PageMessage message)
Called when a page update is received.
subscription
- The subscription for which the update occurred.peer
- The DataSource peer supplying the update.message
- The page update.void subjectErrorReceived(Subscription subscription, Peer peer, SubjectErrorEvent subjectErrorEvent)
Called when there is an error in a subscription.
subscription
- The subscription for which the error occurred.peer
- The DataSource peer that sent this subscription error.subjectErrorEvent
- The subscription error.void subjectStatusReceived(Subscription subscription, Peer peer, SubjectStatusEvent subjectStatusEvent)
Called when there is a change in the status of a subscription.
subscription
- The subscription for which the status change occurred.peer
- The DataSource peer that sent this change in subscription status.subjectStatusEvent
- The subscription status event.Please send bug reports and comments to Caplin support