From cc8ace92f17c8e5aef7d68ff316e5cd038cd36b5 Mon Sep 17 00:00:00 2001 From: Nathan Lasseter Date: Wed, 22 May 2013 15:34:00 +0100 Subject: Initial Commit --- .../client/mqttv3/MqttDefaultFilePersistence.html | 506 +++++++++++++++++++++ 1 file changed, 506 insertions(+) create mode 100644 libs/org.eclipse.paho.client.mqttv3/org/eclipse/paho/client/mqttv3/MqttDefaultFilePersistence.html (limited to 'libs/org.eclipse.paho.client.mqttv3/org/eclipse/paho/client/mqttv3/MqttDefaultFilePersistence.html') diff --git a/libs/org.eclipse.paho.client.mqttv3/org/eclipse/paho/client/mqttv3/MqttDefaultFilePersistence.html b/libs/org.eclipse.paho.client.mqttv3/org/eclipse/paho/client/mqttv3/MqttDefaultFilePersistence.html new file mode 100644 index 0000000..7f73ce0 --- /dev/null +++ b/libs/org.eclipse.paho.client.mqttv3/org/eclipse/paho/client/mqttv3/MqttDefaultFilePersistence.html @@ -0,0 +1,506 @@ + + + + + + +MqttDefaultFilePersistence (MQTT v3 Client API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + +

+ +org.eclipse.paho.client.mqttv3 +
+Class MqttDefaultFilePersistence

+
+java.lang.Object
+  extended byorg.eclipse.paho.client.mqttv3.MqttDefaultFilePersistence
+
+
+
All Implemented Interfaces:
MqttClientPersistence
+
+
+
+
public class MqttDefaultFilePersistence
extends java.lang.Object
implements MqttClientPersistence
+ +

+An implementation of the 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 particular 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 Summary
MqttDefaultFilePersistence() + +
+           
MqttDefaultFilePersistence(java.lang.String directory) + +
+          Create an file-based persistent data store within the specified directory.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidclear() + +
+          Clears persistence, so that it no longer contains any persisted data.
+ voidclose() + +
+          Close the persistent store that was previously opened. +
+ booleancontainsKey(java.lang.String key) + +
+          Returns whether or not data is persisted using the specified key.
+ MqttPersistableget(java.lang.String key) + +
+          Gets the specified data out of the persistent store.
+ java.util.Enumerationkeys() + +
+          Returns all of the persistent data from the previously specified persistence directory.
+ voidopen(java.lang.String clientId, + java.lang.String theConnection) + +
+          Initialise the persistent store. +
+ voidput(java.lang.String key, + MqttPersistable message) + +
+          Writes the specified persistent data to the previously specified persistence directory. +
+ voidremove(java.lang.String key) + +
+          Deletes the data with the specified key from the previously specified persistence directory.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+MqttDefaultFilePersistence

+
+public MqttDefaultFilePersistence()
+                           throws MqttPersistenceException
+
+
+
+ +

+MqttDefaultFilePersistence

+
+public MqttDefaultFilePersistence(java.lang.String directory)
+                           throws MqttPersistenceException
+
+
Create an file-based persistent data store within the specified directory. +

+

Parameters:
directory - the directory to use.
+ + + + + + + + +
+Method Detail
+ +

+open

+
+public void open(java.lang.String clientId,
+                 java.lang.String theConnection)
+          throws MqttPersistenceException
+
+
Description copied from interface: MqttClientPersistence
+
Initialise the persistent store. + If a persistent store exists for this client ID then open it, otherwise + create a new one. If the persistent store is already open then just return. + An application may use the same client ID to connect to many different + servers, so the client ID in conjunction with the + connection will uniquely identify the persistence store required. +

+

+
Specified by:
open in interface MqttClientPersistence
+
+
+
Parameters:
clientId - The client for which the persistent store should be opened.
theConnection - The connection string as specified when the MQTT client instance was created. +
Throws: +
MqttPersistenceException - if there was a problem opening the persistent store.
+
+
+
+ +

+close

+
+public void close()
+           throws MqttPersistenceException
+
+
Description copied from interface: MqttClientPersistence
+
Close the persistent store that was previously opened. + This will be called when a client application disconnects from the broker. +

+

+
Specified by:
close in interface MqttClientPersistence
+
+
+ +
Throws: +
MqttPersistenceException
+
+
+
+ +

+put

+
+public void put(java.lang.String key,
+                MqttPersistable message)
+         throws MqttPersistenceException
+
+
Writes the specified persistent data to the previously specified persistence directory. + This method uses a safe overwrite policy to ensure IO errors do not lose messages. +

+

+
Specified by:
put in interface MqttClientPersistence
+
+
+
Parameters:
message -
key - the key for the data, which will be used later to retrieve it. +
Throws: +
MqttPersistenceException
+
+
+
+ +

+get

+
+public MqttPersistable get(java.lang.String key)
+                    throws MqttPersistenceException
+
+
Description copied from interface: MqttClientPersistence
+
Gets the specified data out of the persistent store. +

+

+
Specified by:
get in interface MqttClientPersistence
+
+
+
Parameters:
key - the key for the data, which was used when originally saving it. +
Returns:
the un-persisted data +
Throws: +
MqttPersistenceException - if there was a problem getting the data + from the persistent store.
+
+
+
+ +

+remove

+
+public void remove(java.lang.String key)
+            throws MqttPersistenceException
+
+
Deletes the data with the specified key from the previously specified persistence directory. +

+

+
Specified by:
remove in interface MqttClientPersistence
+
+
+ +
Throws: +
MqttPersistenceException
+
+
+
+ +

+keys

+
+public java.util.Enumeration keys()
+                           throws MqttPersistenceException
+
+
Returns all of the persistent data from the previously specified persistence directory. +

+

+
Specified by:
keys in interface MqttClientPersistence
+
+
+ +
Returns:
all of the persistent data from the persistence directory. +
Throws: +
MqttPersistenceException
+
+
+
+ +

+containsKey

+
+public boolean containsKey(java.lang.String key)
+                    throws MqttPersistenceException
+
+
Description copied from interface: MqttClientPersistence
+
Returns whether or not data is persisted using the specified key. +

+

+
Specified by:
containsKey in interface MqttClientPersistence
+
+
+
Parameters:
key - the key for data, which was used when originally saving it. +
Throws: +
MqttPersistenceException
+
+
+
+ +

+clear

+
+public void clear()
+           throws MqttPersistenceException
+
+
Description copied from interface: MqttClientPersistence
+
Clears persistence, so that it no longer contains any persisted data. +

+

+
Specified by:
clear in interface MqttClientPersistence
+
+
+ +
Throws: +
MqttPersistenceException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.1