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

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

RecoveryPointAdapter virtual base class for implementing external storage of subscription recovery points and recovery from storage. More...

`#include <SOWRecoveryPointAdapter.hpp>`

Inheritance diagram for AMPS::SOWRecoveryPointAdapter:

## Public Member Functions
| SOWRecoveryPointAdapter (const Client &storeClient_, const string &trackedClientName_, unsigned timeoutMillis_=5000, bool useTimestamp_=false, bool closeClient_=true, bool updateFailureThrows_=false, const string &topic_=AMPS_SOW_STORE_DEFAULT_TOPIC, const string &clientNameField_=AMPS_SOW_STORE_DEFAULT_CLIENT_FIELD, const string &subIdField_=AMPS_SOW_STORE_DEFAULT_SUB_FIELD, const string &bookmarkField_=AMPS_SOW_STORE_DEFAULT_BOOKMARK_FIELD)
| Create a SOWRecoveryPointAdapter for a BookmarkStore that writes updated RecoveryPoints to the server where storeClient_ is connected to the storeTopic_ using trackedClientName_ in the clientNameField_ and the subId from the RecoveryPoint in the subIdField_ as the key fields and the bookmark from the RecoveryPoint in the bookmarkField_ as the bookmark. More...
virtual bool | next (RecoveryPoint &current_)
| Recovery is done by iteration over elements in storage. More...
virtual void | update (RecoveryPoint &recoveryPoint_)
| Update the storage information with the given recovery point. More...
virtual void | purge ()
| Remove all data from the storage.
virtual void | purge (const Field &subId_)
| Remove the specified subId_ from the storage. More...
virtual void | close ()
| Take any necessary actions to close the associated storage.
void | setExceptionListener (const std::shared_ptr< const ExceptionListener > &pListener_)
| Set an exception listener on this adapter that will be notified of all exceptions that occur rather than silently absorbing them. More...
Public Member Functions inherited from AMPS::RecoveryPointAdapterImpl
virtual void | prune ()
| Take any necessary actions to reduce associated storage size.

## Detailed Description

RecoveryPointAdapter virtual base class for implementing external storage of subscription recovery points and recovery from storage.

## Constructor & Destructor Documentation

## ◆ SOWRecoveryPointAdapter()

AMPS::SOWRecoveryPointAdapter::SOWRecoveryPointAdapter | ( | const Client & | storeClient_,
|  | const string & | trackedClientName_,
|  | unsigned | timeoutMillis_ = `5000`,
|  | bool | useTimestamp_ = `false`,
|  | bool | closeClient_ = `true`,
|  | bool | updateFailureThrows_ = `false`,
|  | const string & | topic_ = `AMPS_SOW_STORE_DEFAULT_TOPIC`,
|  | const string & | clientNameField_ = `AMPS_SOW_STORE_DEFAULT_CLIENT_FIELD`,
|  | const string & | subIdField_ = `AMPS_SOW_STORE_DEFAULT_SUB_FIELD`,
|  | const string & | bookmarkField_ = `AMPS_SOW_STORE_DEFAULT_BOOKMARK_FIELD`
| ) |  |
| inline

Create a SOWRecoveryPointAdapter for a BookmarkStore that writes updated RecoveryPoints to the server where storeClient_ is connected to the storeTopic_ using trackedClientName_ in the clientNameField_ and the subId from the RecoveryPoint in the subIdField_ as the key fields and the bookmark from the RecoveryPoint in the bookmarkField_ as the bookmark.

Parameters

  storeClient_ | A Client that is connected and logged on to a server containing the SOW for bookmark storage. This client must NOT be the tracked client.
  trackedClientName_ | The name of the client for which this store is being used. It is an UsageException for trackedClientName_ to match the name of storeClient_.
  timeoutMillis_ | The max time to wait for the sow query that returns bookmarks saved in the store to return the next record.
  useTimestamp_ | If true, the recovered bookmarks will also include the update timestamp, which is useful if the bookmarks are no longer in the transaction log.
  closeClient_ | If true, the storeClient_ will be disconnected when the adapter is closed or destructed. Default is true.
  updateFailureThrows_ | If true, exceptions will be thrown out of this class to the BookmarkStore and eventually the tracked client's exception listener. If false, the default, exceptions are contained and only delivered to the exception listener set on this adapter.
  topic_ | The name of the SOW topic in which to store the RecoveryPoints.
  clientNameField_ | The name of key field in topic_ where the trackedClientName_ is saved for each RecoveryPoint.
  subIdField_ | The name of the key field in topic_ where the subId for each saved RecoveryPoint is stored.
  bookmarkField_ | The name of the field in topic_ where the bookmark from each RecoveryPoint is saved.

## Member Function Documentation

## ◆ next()

virtual bool AMPS::SOWRecoveryPointAdapter::next | ( | RecoveryPoint & | current_ | ) |
| inline virtual

Recovery is done by iteration over elements in storage.

This function modifies the passed in argument to be the next stored RecoveryPoint or an empty RecoveryPoint to indicate completion.

Parameters

  current_ | The RecoveryPoint to set as the next recovery item.

Implements AMPS::RecoveryPointAdapterImpl.

## ◆ purge()

virtual void AMPS::SOWRecoveryPointAdapter::purge | ( | const Field & | subId_ | ) |
| inline virtual

Remove the specified subId_ from the storage.

Parameters

  subId_ | The sub id to remove

Implements AMPS::RecoveryPointAdapterImpl.

## ◆ setExceptionListener()

void AMPS::SOWRecoveryPointAdapter::setExceptionListener | ( | const std::shared_ptr< const ExceptionListener > & | pListener_ | ) |
| inline

Set an exception listener on this adapter that will be notified of all exceptions that occur rather than silently absorbing them.

The exception listener will be ignored if the adapter is constructed with updateFailureThrows_ true; in that case exceptions will leave this adapter to be handled elsewhere.

Parameters

  pListener_ | A shared pointer to the ExceptionListener that should be notified.

## ◆ update()

virtual void AMPS::SOWRecoveryPointAdapter::update | ( | RecoveryPoint & | recoveryPoint_ | ) |
| inline virtual

Update the storage information with the given recovery point.

Parameters

  recoveryPoint_ | The new/updated RecoveryPoint to save.

Implements AMPS::RecoveryPointAdapterImpl.

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

- include/amps/SOWRecoveryPointAdapter.hpp