Package org.jivesoftware.openfire
Class PrivateStorage
java.lang.Object
org.jivesoftware.openfire.container.BasicModule
org.jivesoftware.openfire.PrivateStorage
- All Implemented Interfaces:
Module
Private storage for user accounts (XEP-0049). It is used by some XMPP systems for saving client settings on the server.
This implementation uses the Personal Eventing Protocol implementation to store and retrieve data. This ensures that
XEP-0049 operates on the same data as XEP-0223.
- Author:
- Iain Shigeoka, Guus der Kinderen, guus.der.kinderen@gmail.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidStores private data.org.dom4j.ElementReturns the data stored under a key corresponding to the name and namespace of the given element.booleanReturns true if private storage is enabled.voidsetEnabled(boolean enabled) Sets whether private storage is enabled.Methods inherited from class org.jivesoftware.openfire.container.BasicModule
destroy, getName, initialize, start, stop
-
Constructor Details
-
PrivateStorage
public PrivateStorage()Constructs a new PrivateStore instance.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns true if private storage is enabled.- Returns:
- true if private storage is enabled.
-
setEnabled
public void setEnabled(boolean enabled) Sets whether private storage is enabled.- Parameters:
enabled- true if this private store is enabled.
-
add
Stores private data. If the name and namespace of the element matches another stored private data XML document, then replace it with the new one.- Parameters:
data- the data to store (XML element)username- the username of the account where private data is being stored
-
get
Returns the data stored under a key corresponding to the name and namespace of the given element. The Element must be in the form:<name xmlns='namespace'/>If no data is currently stored under the given key, an empty element will be returned.
- Parameters:
data- an XML document who's element name and namespace is used to match previously stored private data.username- the username of the account where private data is being stored.- Returns:
- the data stored under the given key or the data element.
-