migratorydata::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-cpp/MigratoryDataListener.h>

Public Functions

Name
virtual void onMessage(const MigratoryDataMessage & message) =0
This method handles the real-time messages received from a MigratoryData server for the subscribed subjects.
virtual void onStatus(const std::string & status, std::string & info) =0
This method handles the status notifications.

Detailed Description

class migratorydata::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(
    const MigratoryDataMessage & message
) =0

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

Parameters:

function onStatus

virtual void onStatus(
    const std::string & status,
    std::string & info
) =0

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:

  • [MigratoryDataClient.NOTIFY_SERVER_UP](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-notify_server_up) indicates that the client successfully connected to the MigratoryData server provided in the detail information of the status notification

  • [MigratoryDataClient.NOTIFY_SERVER_DOWN](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-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

  • [MigratoryDataClient.NOTIFY_DATA_SYNC](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-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

  • [MigratoryDataClient.NOTIFY_DATA_RESYNC](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-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
  • [MigratoryDataClient.NOTIFY_SUBSCRIBE_ALLOW](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-notify_subscribe_allow) indicates that the client – identified with the token given in the argument of [MigratoryDataClient.setEntitlementToken()](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#function-setentitlementtoken)– is allowed to subscribe to the subject provided in the detail information of the status notification

  • [MigratoryDataClient.NOTIFY_SUBSCRIBE_DENY](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-notify_subscribe_deny) indicates that the client – identified with the token given in the argument of [MigratoryDataClient.setEntitlementToken()](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#function-setentitlementtoken)– is not allowed to subscribe to the subject provided in the detail information of the status notification

  • [MigratoryDataClient.NOTIFY_PUBLISH_OK](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-notify_publish_ok) indicates that the client successfully published the message having the closure data provided in the detail information of the status notification

  • [MigratoryDataClient.NOTIFY_PUBLISH_FAILED](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-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

  • [MigratoryDataClient.NOTIFY_PUBLISH_DENIED](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#variable-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()](/docs/enterprise/cpp/classes/classmigratorydata_1_1migratorydataclient/#function-setentitlementtoken)– is not allowed to publish on the subject of the message


Updated on 6 November 2020 at 13:20:01 EET