Represents a persistent data store, used to store outbound and inbound messages while they are in flight, enabling delivery to the QoS specified.
More...
|
virtual | ~iclient_persistence () |
| Virtual destructor.
|
|
virtual void | open (const string &clientId, const string &serverURI)=0 |
| Initialize the persistent store. More...
|
|
virtual void | close ()=0 |
| Close the persistent store that was previously opened.
|
|
virtual void | clear ()=0 |
| Clears persistence, so that it no longer contains any persisted data.
|
|
virtual bool | contains_key (const string &key)=0 |
| Returns whether or not data is persisted using the specified key. More...
|
|
virtual const string_collection & | keys () const =0 |
| Returns a collection of keys in this persistent data store. More...
|
|
virtual void | put (const string &key, const std::vector< string_view > &bufs)=0 |
| Puts the specified data into the persistent store. More...
|
|
virtual string_view | get (const string &key) const =0 |
| Gets the specified data out of the persistent store. More...
|
|
virtual void | remove (const string &key)=0 |
| Remove the data for the specified key. More...
|
|
Represents a persistent data store, used to store outbound and inbound messages while they are in flight, enabling delivery to the QoS specified.
You can specify an implementation of this interface using client::client(string, string, iclient_persistence), which the client will use to persist QoS 1 and 2 messages.
If the methods defined throw the MqttPersistenceException then the state of the data persisted should remain as prior to the method being called. For example, if put(string, persistable) throws an exception at any point then the data will be assumed to not be in the persistent store. Similarly if remove(string) throws an exception then the data will be assumed to still be held in the persistent store.
It is up to the persistence interface to log any exceptions or error information which may be required when diagnosing a persistence failure.