MigratoryDataListener

The implementation of this interface will handle the messages received from the server for the subscribed subjects as well as various status notifications. More…

#include <client-ios/MigratoryDataListener.h>

Public Functions

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

Detailed Description

class MigratoryDataListener;

The implementation of this interface will handle the messages received from the server for the subscribed subjects as well as various status notifications.

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

Public Functions Documentation

function onMessage:

virtual void onMessage:(
    MigratoryDataMessage * message
)

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

Parameters:

function onStatus:info:

virtual void onStatus:info:(
    NSString * status,
    NSString * info
)

This method handles the status notifications.

Parameters:

  • status The type of the status notification (see the possible values above).
  • info The detail information of the status notification.

The possible values of the status parameter are:

  • NOTIFY_SERVER_UP indicates that the client successfully connected to the MigratoryData server provided in the detail information of the status notification

  • NOTIFY_SERVER_DOWN indicates that the client was not able to connect to the MigratoryData server provided in the detail information of the status notification

  • 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 recovered all messages made available for that subject during the failover period, if any

  • NOTIFY_DATA_RESYNC indicates that, after a failover reconnection, the client successfully synchronized the subject given in the detail information; however, the potential messages made available for that subject during the failover period have not been recovered, the client behaving like a new client which only received the most recent retained message available for that subject

  • NOTIFY_CONNECT_OK indicates that the client– identified with the token given in the argument of MigratoryDataClient.setEntitlementToken() – is allowed to connect for the reason provided in the detail information of the status notification

  • NOTIFY_CONNECT_DENY indicates that the client – identified with the token given in the argument of MigratoryDataClient.setEntitlementToken() – is denied to connect for the reason provided in the detail information of the status notification

  • 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 notification

  • 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 notification

  • NOTIFY_PUBLISH_OK indicates that the client successfully published the message having the closure data provided in the detail information of the status notification

  • 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 notification

  • 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 message