AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.4.3
AMPS::BookmarkStoreImpl Class Referenceabstract

Abstract base class for storing received bookmarks for HA clients. More...

#include <BookmarkStore.hpp>

+ Inheritance diagram for AMPS::BookmarkStoreImpl:

Public Member Functions

virtual size_t log (Message &message_)=0
 Log a bookmark to the persistent log. More...
 
virtual void discard (const Message::Field &subId_, size_t bookmarkSeqNo_)=0
 Log a discard-bookmark entry to the persistent log based on a bookmark sequence number. More...
 
virtual void discard (const Message &message_)=0
 Log a discard-bookmark entry to the persistent log based on a bookmark sequence number. More...
 
virtual Message::Field getMostRecent (const Message::Field &subId_)=0
 Returns the most recent bookmark from the log that ought to be used for (re-)subscriptions. More...
 
virtual bool isDiscarded (Message &message_)=0
 Called for each arriving message to determine if the application has already seen this bookmark and should not be reprocessed. More...
 
virtual void purge ()=0
 Called to purge the contents of this store. More...
 
virtual void purge (const Message::Field &subId_)=0
 Called to purge the contents of this store for particular subId. More...
 
virtual size_t getOldestBookmarkSeq (const Message::Field &subId_)=0
 Called to find the oldest bookmark sequence in the store. More...
 
virtual void setResizeHandler (BookmarkStoreResizeHandler handler_, void *userData_)
 Set a handler on the bookmark store that will get called whenever a resize of the store is required due to the number of stored bookmarks exceeding the currently allocated storage to hold them. More...
 
virtual void persisted (const Message::Field &subId_, const Message::Field &bookmark_)=0
 Mark the bookmark provided as replicated to all sync replication destinations for the given subscription. More...
 
virtual Message::Field persisted (const Message::Field &subId_, size_t bookmark_)=0
 Mark the bookmark provided as replicated to all sync replication destinations for the given subscription. More...
 
virtual void setServerVersion (size_t version_)=0
 Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent(). More...
 
virtual void setServerVersion (const VersionInfo &version_)=0
 Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent(). More...
 
size_t getMaxSubIdLength () const
 Gets the maximum allowed length for a sub id when recovering a bookmark store from persistent storage. More...
 
void setMaxSubIdLength (size_t maxSubIdLength_)
 Sets the maximum allowed length for a sub id when recovering a bookmark store from persistent storage. More...
 

Detailed Description

Abstract base class for storing received bookmarks for HA clients.

Member Function Documentation

virtual void AMPS::BookmarkStoreImpl::discard ( const Message::Field subId_,
size_t  bookmarkSeqNo_ 
)
pure virtual

Log a discard-bookmark entry to the persistent log based on a bookmark sequence number.

Parameters
subId_The id of the subscription to which the bookmark applies.
bookmarkSeqNo_The bookmark sequence number to discard.

Implemented in AMPS::MemoryBookmarkStore, AMPS::MMapBookmarkStore, AMPS::LoggedBookmarkStore, and AMPS::RingBookmarkStore.

virtual void AMPS::BookmarkStoreImpl::discard ( const Message message_)
pure virtual

Log a discard-bookmark entry to the persistent log based on a bookmark sequence number.

Parameters
message_The Message to discard from the store.

Implemented in AMPS::MemoryBookmarkStore, AMPS::MMapBookmarkStore, AMPS::LoggedBookmarkStore, and AMPS::RingBookmarkStore.

size_t AMPS::BookmarkStoreImpl::getMaxSubIdLength ( ) const
inline

Gets the maximum allowed length for a sub id when recovering a bookmark store from persistent storage.

Returns
The maximum length allowed.
virtual Message::Field AMPS::BookmarkStoreImpl::getMostRecent ( const Message::Field subId_)
pure virtual

Returns the most recent bookmark from the log that ought to be used for (re-)subscriptions.

Parameters
subId_The id of the subscription to check.
Returns
Most recent bookmark.

Implemented in AMPS::MemoryBookmarkStore, AMPS::MMapBookmarkStore, AMPS::LoggedBookmarkStore, and AMPS::RingBookmarkStore.

virtual size_t AMPS::BookmarkStoreImpl::getOldestBookmarkSeq ( const Message::Field subId_)
pure virtual

Called to find the oldest bookmark sequence in the store.

Parameters
subId_The subscription ID on which to find the oldest bookmark.
Returns
The bookmark sequence that is oldest in the store for subId_

Implemented in AMPS::MemoryBookmarkStore.

virtual bool AMPS::BookmarkStoreImpl::isDiscarded ( Message message_)
pure virtual

Called for each arriving message to determine if the application has already seen this bookmark and should not be reprocessed.

Returns 'true' if the bookmark is in the log and should not be re-processed, false otherwise.

Parameters
message_The Message to check.
Returns
Whether or not the bookmark has been discarded.

Implemented in AMPS::MemoryBookmarkStore, AMPS::MMapBookmarkStore, and AMPS::LoggedBookmarkStore.

virtual size_t AMPS::BookmarkStoreImpl::log ( Message message_)
pure virtual

Log a bookmark to the persistent log.

Parameters
message_The Message to log in the store.
Returns
the corresponding bookmark sequence number for this bookmark

Implemented in AMPS::MemoryBookmarkStore, AMPS::MMapBookmarkStore, AMPS::LoggedBookmarkStore, and AMPS::RingBookmarkStore.

virtual void AMPS::BookmarkStoreImpl::persisted ( const Message::Field subId_,
const Message::Field bookmark_ 
)
pure virtual

Mark the bookmark provided as replicated to all sync replication destinations for the given subscription.

Parameters
subId_The subscription Id to which the bookmark applies.
bookmark_The most recent replicated bookmark.

Implemented in AMPS::MemoryBookmarkStore, and AMPS::RingBookmarkStore.

virtual Message::Field AMPS::BookmarkStoreImpl::persisted ( const Message::Field subId_,
size_t  bookmark_ 
)
pure virtual

Mark the bookmark provided as replicated to all sync replication destinations for the given subscription.

Parameters
subId_The subscription Id to which the bookmark applies.
bookmark_The most recent bookmark's sequence number.
Returns
The bookmark field that was just marked persisted.

Implemented in AMPS::MemoryBookmarkStore.

virtual void AMPS::BookmarkStoreImpl::purge ( )
pure virtual

Called to purge the contents of this store.

Removes any tracking history associated with publishers and received messages, and may delete or truncate on-disk representations as well.

Implemented in AMPS::MemoryBookmarkStore, AMPS::MMapBookmarkStore, AMPS::LoggedBookmarkStore, and AMPS::RingBookmarkStore.

virtual void AMPS::BookmarkStoreImpl::purge ( const Message::Field subId_)
pure virtual

Called to purge the contents of this store for particular subId.

Removes any tracking history associated with publishers and received messages, and will remove the subId from the file as well.

Implemented in AMPS::MemoryBookmarkStore, AMPS::LoggedBookmarkStore, AMPS::MMapBookmarkStore, and AMPS::RingBookmarkStore.

void AMPS::BookmarkStoreImpl::setMaxSubIdLength ( size_t  maxSubIdLength_)
inline

Sets the maximum allowed length for a sub id when recovering a bookmark store from persistent storage.

Parameters
maxSubIdLength_The maximum length allowed.
virtual void AMPS::BookmarkStoreImpl::setResizeHandler ( BookmarkStoreResizeHandler  handler_,
void *  userData_ 
)
inlinevirtual

Set a handler on the bookmark store that will get called whenever a resize of the store is required due to the number of stored bookmarks exceeding the currently allocated storage to hold them.

Parameters
handler_The handler to be called when resizing.
userData_User data passed to the handler when it is called.
virtual void AMPS::BookmarkStoreImpl::setServerVersion ( size_t  version_)
pure virtual

Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent().

Parameters
version_The version of the server being used.

Implemented in AMPS::MemoryBookmarkStore, AMPS::LoggedBookmarkStore, and AMPS::MMapBookmarkStore.

virtual void AMPS::BookmarkStoreImpl::setServerVersion ( const VersionInfo &  version_)
pure virtual

Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent().

Parameters
version_The version of the server being used.

Implemented in AMPS::MemoryBookmarkStore, AMPS::LoggedBookmarkStore, and AMPS::MMapBookmarkStore.


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