Interface
caplin.services.messaging

SubscriptionListener

Interface implemented by classes that wish to listen to subscription events.

Constructor Summary

Attributes Name and Description
caplin.services.messaging.SubscriptionListener()

Method Summary

Attributes Name and Description
void onDataUpdate(String sSubject, Map mData, Map mMetaData)

Called when an update is received for the subscribed record.

void onError(String sSubject, caplin.services.messaging.SubscriptionError sErrorType)

Called when there is an error with the subscription.

void onStatusUpdate(String sSubject, caplin.services.messaging.SubscriptionStatus sStatus)

Called when the status of the subscription changes.

Constructor Detail

caplin.services.messaging.SubscriptionListener()

Method Detail

void onDataUpdate(String sSubject, Map mData, Map mMetaData)

Called when an update is received for the subscribed record.

Parameters
String sSubject The subject of the record that the update is for.
Map mData The updated data.
Map mMetaData Meta data for the update. This includes:
  • {Boolean} isImage Whether the update is an image or not.
  • {Number} latency The latency of the record in milliseconds
  • {Number} timeReceived The time that the update was received in milliseconds since 1 January 1970 00:00:00 UTC.

void onError(String sSubject, caplin.services.messaging.SubscriptionError sErrorType)

Called when there is an error with the subscription.

Parameters
String sSubject The subject of the record that had an error.
caplin.services.messaging.SubscriptionError sErrorType The type of error.

void onStatusUpdate(String sSubject, caplin.services.messaging.SubscriptionStatus sStatus)

Called when the status of the subscription changes.

Parameters
String sSubject The subject of the record that changed status.
caplin.services.messaging.SubscriptionStatus sStatus The new status of the subscription.