public interface SubscriptionListener
Interface for receiving updates to subscribed data from the Liberator.
Your application should implement this interface.
A trivial implementation of SubscriptionListener
would be:
import com.caplin.streamlink.ChatEvent;
import com.caplin.streamlink.ContainerEvent;
import com.caplin.streamlink.DirectoryEvent;
import com.caplin.streamlink.NewsEvent;
import com.caplin.streamlink.PermissionEvent;
import com.caplin.streamlink.RecordType1Event;
import com.caplin.streamlink.RecordType2Event;
import com.caplin.streamlink.RecordType3Event;
import com.caplin.streamlink.StoryEvent;
import com.caplin.streamlink.StreamLink;
import com.caplin.streamlink.Subscription;
import com.caplin.streamlink.SubscriptionErrorEvent;
import com.caplin.streamlink.SubscriptionListener;
import com.caplin.streamlink.SubscriptionStatusEvent;
public class SubscriptionListenerSnippet
{
public SubscriptionListenerSnippet(StreamLink streamLink) {
streamLink.subscribe("/SUBJECT", new SubscriptionListener() {
public void onSubscriptionStatus(Subscription subscription,
SubscriptionStatusEvent event) {
System.out.println(event);
}
public void onSubscriptionError(Subscription subscription,
SubscriptionErrorEvent event) {
System.out.println(event);
}
public void onStoryUpdate(Subscription subscription, StoryEvent event) {
System.out.println(event);
}
public void onRecordUpdate(Subscription subscription, RecordType1Event event) {
System.out.println(event);
}
public void onRecordType3Update(Subscription subscription,
RecordType3Event event) {
System.out.println(event);
}
public void onRecordType2Update(Subscription subscription,
RecordType2Event event) {
System.out.println(event);
}
public void onPermissionUpdate(Subscription subscription,
PermissionEvent event) {
System.out.println(event);
}
public void onNewsUpdate(Subscription subscription, NewsEvent event) {
System.out.println(event);
}
public void onDirectoryUpdate(Subscription subscription,
DirectoryEvent event) {
System.out.println(event);
}
public void onContainerUpdate(Subscription subscription,
ContainerEvent event) {
System.out.println(event);
}
public void onChatUpdate(Subscription subscription, ChatEvent event) {
System.out.println(event);
}
});
}
}
Modifier and Type | Method and Description |
---|---|
void |
onChatUpdate(Subscription subscription,
ChatEvent evt)
Called when a chat update is received.
|
void |
onContainerUpdate(Subscription subscription,
ContainerEvent evt)
Called when a container update is received.
|
void |
onDirectoryUpdate(Subscription subscription,
DirectoryEvent evt)
Called when a directory update is received.
|
void |
onNewsUpdate(Subscription subscription,
NewsEvent evt)
Called when a news headline update is received.
|
void |
onPageUpdate(Subscription subscription,
PageEvent evt)
Called when a page update is received.
|
void |
onPermissionUpdate(Subscription subscription,
PermissionEvent evt)
Called when a permission update is received.
|
void |
onRecordType2Update(Subscription subscription,
RecordType2Event evt)
Called when an update to type 2 data in a record is received.
|
void |
onRecordType3Update(Subscription subscription,
RecordType3Event evt)
Called when an update to type 3 data in a record is received.
|
void |
onRecordUpdate(Subscription subscription,
RecordType1Event evt)
Called when an update to type 1 data in a record is received.
|
void |
onStoryUpdate(Subscription subscription,
StoryEvent evt)
Called when a news story update is received.
|
void |
onSubscriptionError(Subscription subscription,
SubscriptionErrorEvent evt)
Called when there is an error in a subscription.
|
void |
onSubscriptionStatus(Subscription subscription,
SubscriptionStatusEvent evt)
Called when there is a change in the status of a subscription.
|
void onRecordUpdate(Subscription subscription, RecordType1Event evt)
Called when an update to type 1 data in a record is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The record update.void onRecordType2Update(Subscription subscription, RecordType2Event evt)
Called when an update to type 2 data in a record is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The record update.void onRecordType3Update(Subscription subscription, RecordType3Event evt)
Called when an update to type 3 data in a record is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The record update.void onPermissionUpdate(Subscription subscription, PermissionEvent evt)
Called when a permission update is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The permission update.void onNewsUpdate(Subscription subscription, NewsEvent evt)
Called when a news headline update is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The news headline update.void onStoryUpdate(Subscription subscription, StoryEvent evt)
Called when a news story update is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The news story update.void onPageUpdate(Subscription subscription, PageEvent evt)
Called when a page update is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The page update.void onChatUpdate(Subscription subscription, ChatEvent evt)
Called when a chat update is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The chat update.void onDirectoryUpdate(Subscription subscription, DirectoryEvent evt)
Called when a directory update is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The directory update.void onContainerUpdate(Subscription subscription, ContainerEvent evt)
Called when a container update is received. Implementing this method is optional.
subscription
- The subscription for which the update occurred.evt
- The container update.void onSubscriptionStatus(Subscription subscription, SubscriptionStatusEvent evt)
Called when there is a change in the status of a subscription.
subscription
- The subscription for which the update occurred.evt
- The subscription status event.void onSubscriptionError(Subscription subscription, SubscriptionErrorEvent evt)
Called when there is an error in a subscription.
This callback being invoked is a final state for the subscription and no further callbacks will be received for it.
subscription
- The subscription for which the error occurred.evt
- The subscription error event.Please send bug reports and comments to Caplin support