MigratoryData Client API for Java
Developer's Guide and Reference Manual
MigratoryDataListener Interface Reference

Implementations of this interface can handle the real-time messages received for the subscribed subjects as well as various status notifications. More...

Inheritance diagram for MigratoryDataListener:
MigratoryDataInteractiveListener

Public Member Functions

void onMessage (MigratoryDataMessage message)
 This method handles the real-time messages received from a MigratoryData server for the subscribed subjects. More...
 
void onStatus (String status, String info)
 This method handles the status notifications. More...
 

Static Public Attributes

static final String NOTIFY_SERVER_UP = "NOTIFY_SERVER_UP"
 Indicate that the client successfully connected to a MigratoryData server. More...
 
static final String NOTIFY_SERVER_DOWN = "NOTIFY_SERVER_DOWN"
 Indicate that the client failed to connect to a MigratoryData server. More...
 
static final String NOTIFY_DATA_SYNC = "NOTIFY_DATA_SYNC"
 After a failover reconnection, the client synchronized a subscribed subject with the latest message available for that subject, as well as with all messages published during the failover for that subject. More...
 
static final String NOTIFY_DATA_RESYNC = "NOTIFY_DATA_RESYNC"
 After a failover reconnection, the client synchronized a subscribed subject with the latest message available for that subject, but not with the potential messages published during the failover, therefore behaving as a new client. More...
 
static final String NOTIFY_SUBSCRIBE_ALLOW = "NOTIFY_SUBSCRIBE_ALLOW"
 Indicate that the client was authorized to subscribe to a subject. More...
 
static final String NOTIFY_SUBSCRIBE_DENY = "NOTIFY_SUBSCRIBE_DENY"
 Indicate that the client was not authorized to subscribe to a subject. More...
 
static final String NOTIFY_SUBSCRIBE_TIMEOUT = "NOTIFY_SUBSCRIBE_TIMEOUT"
 
static final String NOTIFY_PUBLISH_OK = "NOTIFY_PUBLISH_OK"
 Indicate that the client successfully published a message. More...
 
static final String NOTIFY_PUBLISH_FAILED = "NOTIFY_PUBLISH_FAILED"
 Indicate that the client was unable to publish a message. More...
 
static final String NOTIFY_PUBLISH_DENIED = "NOTIFY_PUBLISH_DENIED"
 Indicate that the client was unable to publish a message because it is not allowed by your entitlement rules. More...
 
static final String NOTIFY_PUBLISH_NO_SUBSCRIBER = "NOTIFY_PUBLISH_NO_SUBSCRIBER"
 Indicate that the client was unable to publish a message because there is no client subscribed to the subject of the message. More...
 
static final String SERVICE_DESTROYED = "SERVICE_DESTROYED"
 A constant holding the status type which indicates that the Android service running the push notifications service has been destroyed. More...
 
static final String SERVICE_STOPPED = "SERVICE_STOPPED"
 A constant holding the status type which indicates that the push notifications service has been stopped. More...
 
static final String SERVICE_DOWN_NO_NETWORK = "SERVICE_DOWN_NO_NETWORK"
 A constant holding the status type which indicates that the push notifications service is down. More...
 
static final String SERVICE_START = "SERVICE_START"
 A constant holding the status type which indicates that the push notifications service is up. More...
 
static final String SERVICE_RUNNING = "SERVICE_RUNNING"
 A constant holding the status type which indicates that the push notifications service is running. More...
 
static final String INFO_ERROR_INVALID_SERVER = "invalid server for client configuration"
 A constant holding the info type which indicates that the push notification service has stopped because the list of servers provided with the method MigratoryDataClient.setServers() is null, empty or invalid. The info type is used with status notification MigratoryDataListener.SERVICE_STOPPED . More...
 
static final String INFO_ERROR_INVALID_SUBJECT = "invalid subject for client configuration"
 A constant holding the info type which indicates that the push notification service has stopped because the list of subjects is null, empty or invalid. The info type is used with status notification MigratoryDataListener.SERVICE_STOPPED . More...
 
static final String CONSTANT_WINDOW_BACKOFF = "CONSTANT_WINDOW_BACKOFF"
 A constant used to define the reconnect policy. More...
 
static final String TRUNCATED_EXPONENTIAL_BACKOFF = "TRUNCATED_EXPONENTIAL_BACKOFF"
 A constant used to define the reconnect policy. More...
 
static String TRANSPORT_HTTP = "TRANSPORT_HTTP"
 A constant used to define the transport type. More...
 
static String TRANSPORT_WEBSOCKET = "TRANSPORT_WEBSOCKET"
 A constant used to define the transport type. More...
 

Detailed Description

Implementations of this interface can handle the real-time messages received for the subscribed subjects as well as various status notifications.

Use the API method MigratoryDataClient.setListener() to register your listener implementation.

Member Function Documentation

◆ onMessage()

void MigratoryDataListener.onMessage ( MigratoryDataMessage  message)

This method handles the real-time messages received from a MigratoryData server for the subscribed subjects.

Parameters
messageAn object of type MigratoryDataMessage .

◆ onStatus()

void MigratoryDataListener.onStatus ( String  status,
String  info 
)

This method handles the status notifications.

The possible values of the status parameter are:

  • MigratoryDataListener.NOTIFY_DATA_SYNC indicates that, after a failover reconnection, the client successfully synchronized the subject given in the detail information of the status notification. Moreover, the client received the messages published during the failover period for this subject.
  • MigratoryDataListener.NOTIFY_DATA_RESYNC indicates that, after a failover reconnection, the client successfully synchronized the subject given in the detail information of the status notification. However, the client have not received the potential messages published during the failover period for this subject, the client behaving like a new client which just connected to the MigratoryData server.
  • MigratoryDataListener.NOTIFY_PUBLISH_NO_SUBSCRIBER indicates that the client was unable to publish the message having the closure data provided in the detail information of the status notification because there is no client subscribed to the subject of the message
Parameters
statusThe type of the status notification (see the possible values above).
infoThe detail information of the status notification.

Member Data Documentation

◆ NOTIFY_SERVER_UP

final String MigratoryDataListener.NOTIFY_SERVER_UP = "NOTIFY_SERVER_UP"
static

Indicate that the client successfully connected to a MigratoryData server.

This constant indicates that the client successfully connected to one of the MigratoryData servers defined with the API method MigratoryDataClient.setServers().

◆ NOTIFY_SERVER_DOWN

final String MigratoryDataListener.NOTIFY_SERVER_DOWN = "NOTIFY_SERVER_DOWN"
static

Indicate that the client failed to connect to a MigratoryData server.

This constant indicates that the client failed to connect to one of the MigratoryData servers defined with the API method MigratoryDataClient.setServers().

◆ NOTIFY_DATA_SYNC

final String MigratoryDataListener.NOTIFY_DATA_SYNC = "NOTIFY_DATA_SYNC"
static

After a failover reconnection, the client synchronized a subscribed subject with the latest message available for that subject, as well as with all messages published during the failover for that subject.

This constant indicates that the client successfully synchronized the subject provided in the detail information of the status notification. Also, the potential messages published for that subject during the failover period have been successfully retrieved at the moment of the reconnection.

◆ NOTIFY_DATA_RESYNC

final String MigratoryDataListener.NOTIFY_DATA_RESYNC = "NOTIFY_DATA_RESYNC"
static

After a failover reconnection, the client synchronized a subscribed subject with the latest message available for that subject, but not with the potential messages published during the failover, therefore behaving as a new client.

This constant indicates that the client successfully synchronized the subject provided in the detail information of the status notification. However, the client was unable to get the messages published during the failover. Therefore, it behaves like a new client which connects to the MigratoryData server at the moment of the failover reconnection.

◆ NOTIFY_SUBSCRIBE_ALLOW

final String MigratoryDataListener.NOTIFY_SUBSCRIBE_ALLOW = "NOTIFY_SUBSCRIBE_ALLOW"
static

Indicate that the client was authorized to subscribe to a subject.

This constant indicates that the client – identified with the token defined with the API method MigratoryDataClient.setEntitlementToken() – is allowed to subscribe to the subject provided in the detail information of the status notification.

◆ NOTIFY_SUBSCRIBE_DENY

final String MigratoryDataListener.NOTIFY_SUBSCRIBE_DENY = "NOTIFY_SUBSCRIBE_DENY"
static

Indicate that the client was not authorized to subscribe to a subject.

This constant indicates that the client – identified with the token defined with the API method MigratoryDataClient.setEntitlementToken() – is not allowed to subscribe to the subject provided in the detail information of the status notification.

◆ NOTIFY_PUBLISH_OK

final String MigratoryDataListener.NOTIFY_PUBLISH_OK = "NOTIFY_PUBLISH_OK"
static

Indicate that the client successfully published a message.

This constant is used to indicate that the publication of the message, having the closure provided in the detail information of the status notification, has succeeded.

◆ NOTIFY_PUBLISH_FAILED

final String MigratoryDataListener.NOTIFY_PUBLISH_FAILED = "NOTIFY_PUBLISH_FAILED"
static

Indicate that the client was unable to publish a message.

This constant is used to indicate that the publication of the message, having the closure provided in the detail information of the status notification, has failed.

◆ NOTIFY_PUBLISH_DENIED

final String MigratoryDataListener.NOTIFY_PUBLISH_DENIED = "NOTIFY_PUBLISH_DENIED"
static

Indicate that the client was unable to publish a message because it is not allowed by your entitlement rules.

This constant is used to indicate that the publication of the message, having the closure provided in the detail information of the status notification, has failed. The publication failed because the client – identified with the token defined with the API method MigratoryDataClient.setEntitlementToken() – is not allowed to publish on the subject of the message.

◆ NOTIFY_PUBLISH_NO_SUBSCRIBER

final String MigratoryDataListener.NOTIFY_PUBLISH_NO_SUBSCRIBER = "NOTIFY_PUBLISH_NO_SUBSCRIBER"
static

Indicate that the client was unable to publish a message because there is no client subscribed to the subject of the message.

This constant is used to indicate that the publication of the message, having the closure provided in the detail information of the status notification, has failed. The publication failed because there is no client then subscribed to the subject of the message.

Deprecated:
no more in use

◆ SERVICE_DESTROYED

final String MigratoryDataListener.SERVICE_DESTROYED = "SERVICE_DESTROYED"
static

A constant holding the status type which indicates that the Android service running the push notifications service has been destroyed.

This constant indicated that the Android service notification service has been killed by the operating system.

Attention
Used only in MigratoryData PushNotification API for Android

◆ SERVICE_STOPPED

final String MigratoryDataListener.SERVICE_STOPPED = "SERVICE_STOPPED"
static

A constant holding the status type which indicates that the push notifications service has been stopped.

This constant indicated that the push notifications service is stopped.

Attention
Used only in MigratoryData PushNotification API for Android

◆ SERVICE_DOWN_NO_NETWORK

final String MigratoryDataListener.SERVICE_DOWN_NO_NETWORK = "SERVICE_DOWN_NO_NETWORK"
static

A constant holding the status type which indicates that the push notifications service is down.

This constant indicated that the push notifications service has been stopped because the phone has no network connectivity.

Attention
Used only in MigratoryData PushNotification API for Android

◆ SERVICE_START

final String MigratoryDataListener.SERVICE_START = "SERVICE_START"
static

A constant holding the status type which indicates that the push notifications service is up.

This constant indicated that the push notifications service has been started.

Attention
Used only in MigratoryData PushNotification API for Android

◆ SERVICE_RUNNING

final String MigratoryDataListener.SERVICE_RUNNING = "SERVICE_RUNNING"
static

A constant holding the status type which indicates that the push notifications service is running.

This constant indicated that the push notifications service is running.

Attention
Used only in MigratoryData PushNotification API for Android

◆ INFO_ERROR_INVALID_SERVER

final String MigratoryDataListener.INFO_ERROR_INVALID_SERVER = "invalid server for client configuration"
static

A constant holding the info type which indicates that the push notification service has stopped because the list of servers provided with the method MigratoryDataClient.setServers() is null, empty or invalid. The info type is used with status notification MigratoryDataListener.SERVICE_STOPPED .

This constant indicated that the list of servers is invalid.

Attention
Used only in MigratoryData PushNotification API for Android

◆ INFO_ERROR_INVALID_SUBJECT

final String MigratoryDataListener.INFO_ERROR_INVALID_SUBJECT = "invalid subject for client configuration"
static

A constant holding the info type which indicates that the push notification service has stopped because the list of subjects is null, empty or invalid. The info type is used with status notification MigratoryDataListener.SERVICE_STOPPED .

This constant indicated that the list of subjects is invalid.

Attention
Used only in MigratoryData PushNotification API for Android

◆ CONSTANT_WINDOW_BACKOFF

final String MigratoryDataListener.CONSTANT_WINDOW_BACKOFF = "CONSTANT_WINDOW_BACKOFF"
static

A constant used to define the reconnect policy.

See MigratoryDataClient.setQuickReconnectInitialDelay() for more details about this policy.

◆ TRUNCATED_EXPONENTIAL_BACKOFF

final String MigratoryDataListener.TRUNCATED_EXPONENTIAL_BACKOFF = "TRUNCATED_EXPONENTIAL_BACKOFF"
static

A constant used to define the reconnect policy.

See MigratoryDataClient.setQuickReconnectInitialDelay() for more details about this policy.

◆ TRANSPORT_HTTP

String MigratoryDataListener.TRANSPORT_HTTP = "TRANSPORT_HTTP"
static

A constant used to define the transport type.

See MigratoryDataClient.setTransport() for more details about this policy.

◆ TRANSPORT_WEBSOCKET

String MigratoryDataListener.TRANSPORT_WEBSOCKET = "TRANSPORT_WEBSOCKET"
static

A constant used to define the transport type.

See MigratoryDataClient.setTransport() for more details about this policy.