Class
caplin.streamlink

SubscriptionListener

Interface for receiving updates to subscribed data from the Liberator.

Your application should implement this interface.

A trivial implementation of SubscriptionListener would be:

// every possible callback.
//
// This trivial implementation just logs the update event
// for each type of data that can be received.
//

streamLink.subscribe("/SUBJECT", {
        onSubscriptionStatus: function(subscription, event) {
                console.log(event);
        },
        onSubscriptionError: function(subscription, event) {
                console.log(event);
        },
        onStoryUpdate: function(subscription, event) {
                console.log(event);
        },
        onRecordUpdate: function(subscription, event) {
                console.log(event);
        },
        onRecordType2Update: function(subscription, event) {
                console.log(event);
        },
        onRecordType3Update: function(subscription, event) {
                console.log(event);
        },
        onPermissionUpdate: function(subscription, event) {
                console.log(event);
        },
        onNewsUpdate: function(subscription, event) {
                console.log(event);
        },
        onDirectoryUpdate: function(subscription, event) {
                console.log(event);
        },
        onContainerUpdate: function(subscription, event) {
                console.log(event);
        },
        onChatUpdate: function(subscription, event) {
                console.log(event);
        },
        onPageUpdate: function(subscription, event) {
                console.log(event);
        }
}, null);

Constructor Summary

Attributes Name and Description
caplin.streamlink.SubscriptionListener()

Method Summary

Attributes Name and Description
void onChatUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.ChatEvent evt)

Called when a chat update is received.

void onContainerUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.ContainerEvent evt)

Called when a container update is received.

void onDirectoryUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.DirectoryEvent evt)

Called when a directory update is received.

void onJsonUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.JsonEvent evt)

Called when a json update is received.

void onNewsUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.NewsEvent evt)

Called when a news headline update is received.

void onPageUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.PageEvent evt)

Called when a page update is received.

void onPermissionUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.PermissionEvent evt)

Called when a permission update is received.

void onRecordType2Update(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType2Event evt)

Called when an update to type 2 data in a record is received.

void onRecordType3Update(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType3Event evt)

Called when an update to type 3 data in a record is received.

void onRecordUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType1Event evt)

Called when an update to type 1 data in a record is received.

void onStoryUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.StoryEvent evt)

Called when a news story update is received.

void onSubscriptionError(caplin.streamlink.Subscription subscription, caplin.streamlink.SubscriptionErrorEvent evt)

Called when there is an error in a subscription.

void onSubscriptionStatus(caplin.streamlink.Subscription subscription, caplin.streamlink.SubscriptionStatusEvent evt)

Called when there is a change in the status of a subscription.

Constructor Detail

caplin.streamlink.SubscriptionListener()

Method Detail

void onChatUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.ChatEvent evt)

Called when a chat update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.ChatEvent evt The chat update.

void onContainerUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.ContainerEvent evt)

Called when a container update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.ContainerEvent evt The container update.

void onDirectoryUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.DirectoryEvent evt)

Called when a directory update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.DirectoryEvent evt The directory update.

void onJsonUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.JsonEvent evt)

Called when a json update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.JsonEvent evt The JSON update.

void onNewsUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.NewsEvent evt)

Called when a news headline update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.NewsEvent evt The news headline update.

void onPageUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.PageEvent evt)

Called when a page update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.PageEvent evt The page update.

void onPermissionUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.PermissionEvent evt)

Called when a permission update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.PermissionEvent evt The permission update.

void onRecordType2Update(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType2Event evt)

Called when an update to type 2 data in a record is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.RecordType2Event evt The record update.

void onRecordType3Update(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType3Event evt)

Called when an update to type 3 data in a record is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.RecordType3Event evt The record update.

void onRecordUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType1Event evt)

Called when an update to type 1 data in a record is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.RecordType1Event evt The record update.

void onStoryUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.StoryEvent evt)

Called when a news story update is received. Implementing this method is optional.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.StoryEvent evt The news story update.

void onSubscriptionError(caplin.streamlink.Subscription subscription, caplin.streamlink.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.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the error occurred.
caplin.streamlink.SubscriptionErrorEvent evt The subscription error event.

void onSubscriptionStatus(caplin.streamlink.Subscription subscription, caplin.streamlink.SubscriptionStatusEvent evt)

Called when there is a change in the status of a subscription.

Parameters
caplin.streamlink.Subscription subscription The subscription for which the update occurred.
caplin.streamlink.SubscriptionStatusEvent evt The subscription status event.