MigratoryData Client API for Java
Developer's Guide and Reference Manual
|
Implementations of this interface can handle the real-time messages received for the subscribed subjects as well as various status notifications. More...
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... | |
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.
void MigratoryDataListener.onMessage | ( | MigratoryDataMessage | message | ) |
This method handles the real-time messages received from a MigratoryData server for the subscribed subjects.
message | An object of type MigratoryDataMessage . |
void MigratoryDataListener.onStatus | ( | String | status, |
String | info | ||
) |
This method handles the status notifications.
The possible values of the status
parameter are:
MigratoryDataListener.NOTIFY_SERVER_UP
indicates that the client successfully connected to the MigratoryData server provided in the detail information of the status notificationMigratoryDataListener.NOTIFY_SERVER_DOWN
indicates that the client was not able to connect to the MigratoryData server provided in the detail information of the status notificationMigratoryDataListener.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_SUBSCRIBE_ALLOW
indicates that the client – identified with the token given in the argument of MigratoryDataClient.setEntitlementToken()
– is allowed to subscribe to the subject provided in the detail information of the status notificationMigratoryDataListener.NOTIFY_SUBSCRIBE_DENY
indicates that the client – identified with the token given in the argument of MigratoryDataClient.setEntitlementToken()
– is not allowed to subscribe to the subject provided in the detail information of the status notificationMigratoryDataListener.NOTIFY_PUBLISH_OK
indicates that the client successfully published the message having the closure data provided in the detail information of the status notificationMigratoryDataListener.NOTIFY_PUBLISH_FAILED
indicates that the client was unable to publish the message having the closure data provided in the detail information of the status notificationMigratoryDataListener.NOTIFY_PUBLISH_DENIED
indicates that the client was unable to publish the message having the closure data provided in the detail information of the status notification because the client – identified with the token given in the argument of MigratoryDataClient.setEntitlementToken()
– is not allowed to publish on the subject of the messageMigratoryDataListener.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 messagestatus | The type of the status notification (see the possible values above). |
info | The detail information of the status notification. |
|
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().
|
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().
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
static |
A constant used to define the reconnect policy.
See MigratoryDataClient.setQuickReconnectInitialDelay() for more details about this policy.
|
static |
A constant used to define the reconnect policy.
See MigratoryDataClient.setQuickReconnectInitialDelay() for more details about this policy.
|
static |
A constant used to define the transport type.
See MigratoryDataClient.setTransport() for more details about this policy.
|
static |
A constant used to define the transport type.
See MigratoryDataClient.setTransport() for more details about this policy.