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

Public Member Functions | List of all members
AMPS::SubscriptionManager Class Referenceabstract

Abstract base class to manage all subscriptions placed on a client so that they can be re-established if the client is disconnected and then reconnected. More...

`#include <ampsplusplus.hpp>`

Inheritance diagram for AMPS::SubscriptionManager:

## Public Member Functions
virtual AMPS_ATOMIC_BASE_TYPE | subscribe (MessageHandler messageHandler_, const Message &message_, unsigned requestedAckTypes_)=0
| Called by Client when a subscription is placed. More...
virtual AMPS_ATOMIC_BASE_TYPE | getGenerationCount () const
| Gets the current subscription manager generation count. More...
virtual void | unsubscribe (const Message::Field &subId_)=0
| Called by Client when a subscription is unsubscribed. More...
virtual void | clear ()=0
| Clear subscriptions and reset to the initial state.
virtual void | resubscribe (Client &client_)=0
| Called by Client to get all subscriptions placed again. More...
virtual void | setFailedResubscribeHandler (std::shared_ptr< FailedResubscribeHandler > handler_)
| Set a handler to deal with failing subscriptions after a failover event. More...

## Detailed Description

Abstract base class to manage all subscriptions placed on a client so that they can be re-established if the client is disconnected and then reconnected.

## Member Function Documentation

## ◆ getGenerationCount()

virtual AMPS_ATOMIC_BASE_TYPE AMPS::SubscriptionManager::getGenerationCount | ( |  | ) | const
| inline virtual

Gets the current subscription manager generation count.

Returns
  The current generation count.

Reimplemented in AMPS::MemorySubscriptionManager.

## ◆ resubscribe()

virtual void AMPS::SubscriptionManager::resubscribe | ( | Client & | client_ | ) |
| pure virtual

Called by Client to get all subscriptions placed again.

Parameters

  client_ | The Client on which to place all subscriptions.

Implemented in AMPS::MemorySubscriptionManager.

## ◆ setFailedResubscribeHandler()

virtual void AMPS::SubscriptionManager::setFailedResubscribeHandler | ( | std::shared_ptr< FailedResubscribeHandler > | handler_ | ) |
| inline virtual

Set a handler to deal with failing subscriptions after a failover event.

Parameters

  handler_ | The handler on which to call `failure`.

## ◆ subscribe()

virtual AMPS_ATOMIC_BASE_TYPE AMPS::SubscriptionManager::subscribe | ( | MessageHandler | messageHandler_,
|  | const Message & | message_,
|  | unsigned | requestedAckTypes_
| ) |  |
| pure virtual

Called by Client when a subscription is placed.

Not all parameters are appropriate for all subscriptions, so the operation type determines which ones are required and/or useful.

Parameters

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

Returns
  The subscription manager generation count after storing the subscription.

Implemented in AMPS::MemorySubscriptionManager.

## ◆ unsubscribe()

virtual void AMPS::SubscriptionManager::unsubscribe | ( | const Message::Field & | subId_ | ) |
| pure virtual

Called by Client when a subscription is unsubscribed.

Parameters

  subId_ | The identifier of the subscription being unsubscribed.

Implemented in AMPS::MemorySubscriptionManager.

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

- include/amps/ampsplusplus.hpp