public class AppSyncMqttPersistence
extends java.lang.Object
MqttClientPersistence interface that provides
file based persistence.
A directory is specified when the Persistence object is created. When the persistence
is then opened (see open(String, String)), a sub-directory is made beneath the base
for this client ID and connection key. This allows one persistence base directory
to be shared by multiple clients.
The sub-directory's name is created from a concatenation of the client ID and connection key
with any instance of '/', '\\', ':' or ' ' removed.| Constructor and Description |
|---|
AppSyncMqttPersistence() |
AppSyncMqttPersistence(java.lang.String directory)
Create an file-based persistent data store within the specified directory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
close() |
boolean |
containsKey(java.lang.String key) |
MqttPersistable |
get(java.lang.String key) |
java.util.Enumeration |
keys()
Returns all of the persistent data from the previously specified persistence directory.
|
void |
open(java.lang.String clientId,
java.lang.String theConnection) |
void |
put(java.lang.String key,
MqttPersistable message)
Writes the specified persistent data to the previously specified persistence directory.
|
void |
remove(java.lang.String key)
Deletes the data with the specified key from the previously specified persistence directory.
|
public AppSyncMqttPersistence()
public AppSyncMqttPersistence(java.lang.String directory)
directory - the directory to use.public void open(java.lang.String clientId,
java.lang.String theConnection)
throws MqttPersistenceException
MqttPersistenceExceptionpublic void close()
throws MqttPersistenceException
MqttPersistenceExceptionpublic void put(java.lang.String key,
MqttPersistable message)
throws MqttPersistenceException
message - MqttPersistenceExceptionpublic MqttPersistable get(java.lang.String key)
throws MqttPersistenceException
MqttPersistenceExceptionpublic void remove(java.lang.String key)
throws MqttPersistenceException
MqttPersistenceExceptionpublic java.util.Enumeration keys()
throws MqttPersistenceException
MqttPersistenceExceptionpublic boolean containsKey(java.lang.String key)
throws MqttPersistenceException
MqttPersistenceExceptionpublic void clear()
throws MqttPersistenceException
MqttPersistenceException