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, caplin.streamlink.ChatEvent event)

Called when a chat update is received.

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

Called when a container update is received.

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

Called when a directory update is received.

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

Called when a news headline update is received.

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

Called when a permission update is received.

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

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

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

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

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

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

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

Called when a news story update is received.

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

Called when there is an error in a subscription.

void onSubscriptionStatus(caplin.streamlink.Subscription subscription, caplin.streamlink.SubscriptionStatusEvent 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, caplin.streamlink.ChatEvent 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.
caplin.streamlink.ChatEvent event The chat update.

void onContainerUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.ContainerEvent 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.
caplin.streamlink.ContainerEvent event The container update.

void onDirectoryUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.DirectoryEvent 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.
caplin.streamlink.DirectoryEvent event The directory update.

void onNewsUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.NewsEvent 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.
caplin.streamlink.NewsEvent event The news headline update.

void onPermissionUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.PermissionEvent 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.
caplin.streamlink.PermissionEvent event The permission update.

void onRecordType2Update(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType2Event 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.
caplin.streamlink.RecordType2Event event The record update.

void onRecordType3Update(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType3Event 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.
caplin.streamlink.RecordType3Event event The record update.

void onRecordUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.RecordType1Event 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.
caplin.streamlink.RecordType1Event event The record update.

void onStoryUpdate(caplin.streamlink.Subscription subscription, caplin.streamlink.StoryEvent 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.
caplin.streamlink.StoryEvent event The news story update.

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

Called when there is an error in a subscription.

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

void onSubscriptionStatus(caplin.streamlink.Subscription subscription, caplin.streamlink.SubscriptionStatusEvent 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.
caplin.streamlink.SubscriptionStatusEvent event The subscription status event.