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);
        }
        
}, null);

Constructor Summary

Attributes Name and Description
caplin.streamlink.SubscriptionListener()

Method Summary

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

Called when a chat update is received.

void onContainerUpdate(caplin.streamlink.Subscription subscription, event)

Called when a container update is received.

void onDirectoryUpdate(caplin.streamlink.Subscription subscription, event)

Called when a directory update is received.

void onNewsUpdate(caplin.streamlink.Subscription subscription, event)

Called when a news headline update is received.

void onPermissionUpdate(caplin.streamlink.Subscription subscription, event)

Called when a permission update is received.

void onRecordType2Update(caplin.streamlink.Subscription subscription, event)

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

void onRecordType3Update(caplin.streamlink.Subscription subscription, event)

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

void onRecordUpdate(caplin.streamlink.Subscription subscription, event)

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

void onStoryUpdate(caplin.streamlink.Subscription subscription, event)

Called when a news story update is received.

void onSubscriptionError(caplin.streamlink.Subscription subscription, event)

Called when there is an error in a subscription.

void onSubscriptionStatus(caplin.streamlink.Subscription subscription, event)

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, event)

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

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

void onContainerUpdate(caplin.streamlink.Subscription subscription, event)

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

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

void onDirectoryUpdate(caplin.streamlink.Subscription subscription, event)

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

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

void onNewsUpdate(caplin.streamlink.Subscription subscription, event)

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.
event The news headline update.

void onPermissionUpdate(caplin.streamlink.Subscription subscription, event)

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

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

void onRecordType2Update(caplin.streamlink.Subscription subscription, event)

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.
event The record update.

void onRecordType3Update(caplin.streamlink.Subscription subscription, event)

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.
event The record update.

void onRecordUpdate(caplin.streamlink.Subscription subscription, event)

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.
event The record update.

void onStoryUpdate(caplin.streamlink.Subscription subscription, event)

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.
event The news story update.

void onSubscriptionError(caplin.streamlink.Subscription subscription, event)

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.
event The subscription error event.

void onSubscriptionStatus(caplin.streamlink.Subscription subscription, event)

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

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