AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.3.1
AMPS::BookmarkStore Class Reference

Interface for BookmarkStoreImpl classes. More...

#include <BookmarkStore.hpp>

Public Member Functions

 BookmarkStore ()
 Creates a BookmarkStore that does nothing.
 
 BookmarkStore (BookmarkStoreImpl *impl_)
 Creates a BookmarkStore based on the given implementation.
 
void setImplementation (BookmarkStoreImpl *impl_)
 Sets the BookmarkStore to use the given implementation.
 
size_t log (Message &message_)
 Log a bookmark to the persistent log. More...
 
void discard (const Message::Field &subId_, size_t bookmarkSeqNo_)
 Log a discard-bookmark entry to the persistent log based on a bookmark sequence number. More...
 
void discard (const Message &message_)
 Log a discard-bookmark entry to the persistent log based on a Message. More...
 
Message::Field getMostRecent (const Message::Field &subId_)
 Returns the most recent bookmark from the log that ought to be used for (re-)subscriptions. More...
 
bool isDiscarded (Message &message_)
 Called for each arriving message to determine if the application has already seen this bookmark and should not be reprocessed. More...
 
void purge ()
 Called to purge the contents of this store. More...
 
void purge (const Message::Field &subId_)
 Called to purge the contents of this store for particular subId. More...
 
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...
 
size_t getOldestBookmarkSeq (const std::string &subId_)
 Called to find the oldest bookmark in the store. More...
 
size_t getOldestBookmarkSeq (const Message::Field &subId_)
 Called to find the oldest bookmark sequence in the store. More...
 
void persisted (const Message::Field &subId_, const Message::Field &bookmark_)
 Called internally to indicate messages up to and including bookmark are replicated to all replication destinations. More...
 
void persisted (const Message::Field &subId_, size_t bookmark_)
 Called internally to indicate messages up to and including bookmark are replicated to all replication destinations. More...
 
void setServerVersion (size_t version_)
 Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent(). More...
 
void setServerVersion (const VersionInfo &version_)
 Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent(). More...
 
void prune (const std::string &tmpFileName_="")
 Used to trim the size of a store's storage. More...
 
BookmarkStoreImplget ()
 Used to get a pointer to the implementation. 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

Interface for BookmarkStoreImpl classes.

Member Function Documentation

void AMPS::BookmarkStore::discard ( const Message::Field subId_,
size_t  bookmarkSeqNo_ 
)
inline

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.
void AMPS::BookmarkStore::discard ( const Message message_)
inline

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

Parameters
message_The message to discard.
BookmarkStoreImpl* AMPS::BookmarkStore::get ( )
inline

Used to get a pointer to the implementation.

Returns
The BookmarkStoreImpl* for this store's implementation.
size_t AMPS::BookmarkStore::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.
Message::Field AMPS::BookmarkStore::getMostRecent ( const Message::Field subId_)
inline

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.
size_t AMPS::BookmarkStore::getOldestBookmarkSeq ( const std::string &  subId_)
inline

Called to find the oldest bookmark 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_
size_t AMPS::BookmarkStore::getOldestBookmarkSeq ( const Message::Field subId_)
inline

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_
bool AMPS::BookmarkStore::isDiscarded ( Message message_)
inline

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.
size_t AMPS::BookmarkStore::log ( Message message_)
inline

Log a bookmark to the persistent log.

Parameters
message_The Message to log.
Returns
the corresponding bookmark sequence number for this bookmark
void AMPS::BookmarkStore::persisted ( const Message::Field subId_,
const Message::Field bookmark_ 
)
inline

Called internally to indicate messages up to and including bookmark are replicated to all replication destinations.

Parameters
subId_The subscription Id to which the bookmark applies.
bookmark_The most recent bookmark replicated everywhere.
void AMPS::BookmarkStore::persisted ( const Message::Field subId_,
size_t  bookmark_ 
)
inline

Called internally to indicate messages up to and including bookmark are replicated to all replication destinations.

Parameters
subId_The subscription Id to which the bookmark applies.
bookmark_The most recent bookmark replicated everywhere.
void AMPS::BookmarkStore::prune ( const std::string &  tmpFileName_ = "")
inline

Used to trim the size of a store's storage.

Implemented for file-based stores to remove items no longer necessary to create the current state.

Parameters
tmpFileName_The name to use for the temporary file created while pruning the bookmark store.
void AMPS::BookmarkStore::purge ( )
inline

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.

void AMPS::BookmarkStore::purge ( const Message::Field subId_)
inline

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.

void AMPS::BookmarkStore::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.
void AMPS::BookmarkStore::setResizeHandler ( BookmarkStoreResizeHandler  handler_,
void *  userData_ 
)
inline

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.
void AMPS::BookmarkStore::setServerVersion ( size_t  version_)
inline

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.
void AMPS::BookmarkStore::setServerVersion ( const VersionInfo &  version_)
inline

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.

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