public class MemoryPersistence extends Object implements MqttClientPersistence
| Constructor and Description |
|---|
MemoryPersistence() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears persistence, so that it no longer contains any persisted data.
|
void |
close()
Close the persistent store that was previously opened.
|
boolean |
containsKey(String key)
Returns whether or not data is persisted using the specified key.
|
MqttPersistable |
get(String key)
Gets the specified data out of the persistent store.
|
Enumeration |
keys()
Returns an Enumeration over the keys in this persistent data store.
|
void |
open(String clientId,
String serverURI)
Initialise the persistent store.
|
void |
put(String key,
MqttPersistable persistable)
Puts the specified data into the persistent store.
|
void |
remove(String key)
Remove the data for the specified key.
|
public void close()
throws MqttPersistenceException
MqttClientPersistenceclose in interface MqttClientPersistenceMqttPersistenceExceptionpublic Enumeration keys() throws MqttPersistenceException
MqttClientPersistencekeys in interface MqttClientPersistenceString objects.MqttPersistenceExceptionpublic MqttPersistable get(String key) throws MqttPersistenceException
MqttClientPersistenceget in interface MqttClientPersistencekey - the key for the data, which was used when originally saving it.MqttPersistenceException - if there was a problem getting the data
from the persistent store.public void open(String clientId, String serverURI) throws MqttPersistenceException
MqttClientPersistenceopen in interface MqttClientPersistenceclientId - The client for which the persistent store should be opened.serverURI - The connection string as specified when the MQTT client instance was created.MqttPersistenceException - if there was a problem opening the persistent store.public void put(String key, MqttPersistable persistable) throws MqttPersistenceException
MqttClientPersistenceput in interface MqttClientPersistencekey - the key for the data, which will be used later to retrieve it.persistable - the data to persistMqttPersistenceException - if there was a problem putting the data
into the persistent store.public void remove(String key) throws MqttPersistenceException
MqttClientPersistenceremove in interface MqttClientPersistenceMqttPersistenceExceptionpublic void clear()
throws MqttPersistenceException
MqttClientPersistenceclear in interface MqttClientPersistenceMqttPersistenceExceptionpublic boolean containsKey(String key) throws MqttPersistenceException
MqttClientPersistencecontainsKey in interface MqttClientPersistencekey - the key for data, which was used when originally saving it.MqttPersistenceExceptionCopyright © 2017 Eclipse Paho. All Rights Reserved.