AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.1

Public Member Functions | Static Public Member Functions | List of all members
AMPS::MemorySubscriptionManager Class Reference

A SubscriptionManager implementation that maintains subscriptions placed in memory so that they can be placed again after a reconnect. More...

`#include <MemorySubscriptionManager.hpp>`

Inheritance diagram for AMPS::MemorySubscriptionManager:

## Public Member Functions
void | subscribe (MessageHandler messageHandler_, const Message &message_, unsigned requestedAckTypes_)
| Save a subscription so it can be placed again if a disconnect occurs. More...
void | unsubscribe (const Message::Field &subId_)
| Remove the subscription from the manager. More...
void | clear ()
| Clear all subscriptions from the manager.
void | _clear ()
| Clear all subscriptions from the manager.
void | resubscribe (Client &client_)
| Place all saved subscriptions on the provided Client. More...
void | setResubscriptionTimeout (int timeout_)
| Sets the timeout used when trying to resubscribe after disconnect. More...
int | getResubscriptionTimeout (void)
| Gets the timeout used when trying to resubscribe after disconnect. More...
Public Member Functions inherited from AMPS::SubscriptionManager
virtual void | setFailedResubscribeHandler (std::shared_ptr< FailedResubscribeHandler > handler_)
| Set a handler to deal with failing subscriptions after a failover event. More...

## Static Public Member Functions
static int | setDefaultResubscriptionTimeout (int timeout_)
| Sets the default timeout used by new MemorySubscriptionManager objects when trying to resubscribe after disconnect. More...
static int | getDefaultResubscriptionTimeout (void)
| Gets the default timeout used by new MemorySubscriptionManager objects when trying to resubscribe after disconnect. More...

## Detailed Description

A SubscriptionManager implementation that maintains subscriptions placed in memory so that they can be placed again after a reconnect.

## Member Function Documentation

## ◆ getDefaultResubscriptionTimeout()

static int AMPS::MemorySubscriptionManager::getDefaultResubscriptionTimeout | ( | void |  | ) |
| inline static

Gets the default timeout used by new MemorySubscriptionManager objects when trying to resubscribe after disconnect.

Returns
  The timeout used in milliseconds.

## ◆ getResubscriptionTimeout()

int AMPS::MemorySubscriptionManager::getResubscriptionTimeout | ( | void |  | ) |
| inline

Gets the timeout used when trying to resubscribe after disconnect.

Returns
  The timeout used in milliseconds.

## ◆ resubscribe()

void AMPS::MemorySubscriptionManager::resubscribe | ( | Client & | client_ | ) |
| inline virtual

Place all saved subscriptions on the provided Client.

Parameters

  client_ | The Client on which to place the subscriptions.

Implements AMPS::SubscriptionManager.

## ◆ setDefaultResubscriptionTimeout()

static int AMPS::MemorySubscriptionManager::setDefaultResubscriptionTimeout | ( | int | timeout_ | ) |
| inline static

Sets the default timeout used by new MemorySubscriptionManager objects when trying to resubscribe after disconnect.

Parameters

  timeout_ | The timeout to use in milliseconds.

## ◆ setResubscriptionTimeout()

void AMPS::MemorySubscriptionManager::setResubscriptionTimeout | ( | int | timeout_ | ) |
| inline

Sets the timeout used when trying to resubscribe after disconnect.

Parameters

  timeout_ | The timeout to use in milliseconds.

## ◆ subscribe()

void AMPS::MemorySubscriptionManager::subscribe | ( | MessageHandler | messageHandler_,
|  | const Message & | message_,
|  | unsigned | requestedAckTypes_
| ) |  |
| inline virtual

Save a subscription so it can be placed again if a disconnect occurs.

Generally used only internally by Client when subscriptions are placed.

Parameters

  messageHandler_ | The MessageHandler used for the subscription.
  message_ | The Message containing the subscription to reissue.
  requestedAckTypes_ | The ack types requested for the handler.

Implements AMPS::SubscriptionManager.

## ◆ unsubscribe()

void AMPS::MemorySubscriptionManager::unsubscribe | ( | const Message::Field & | subId_ | ) |
| inline virtual

Remove the subscription from the manager.

Parameters

  subId_ | The subscription ID of the subscription to remove.

Implements AMPS::SubscriptionManager.

The documentation for this class was generated from the following file:

- include/amps/MemorySubscriptionManager.hpp