Class PrivateDataManager
- java.lang.Object
-
- rocks.xmpp.core.session.Manager
-
- rocks.xmpp.extensions.privatedata.PrivateDataManager
-
public final class PrivateDataManager extends Manager
This class implements XEP-0049: Private XML Storage.It allows to retrieve and store private data in the server's private XML storage.
This class is thread-safe.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> AsyncResult<T>
getData(Class<T> type)
Gets private data, which is stored on the server.AsyncResult<Void>
storeData(Object privateData)
Stores private data.-
Methods inherited from class rocks.xmpp.core.session.Manager
isEnabled, setEnabled
-
-
-
-
Method Detail
-
getData
public final <T> AsyncResult<T> getData(Class<T> type)
Gets private data, which is stored on the server.- Type Parameters:
T
- The type of private data.- Parameters:
type
- The class of the private data. Note that this class needs a no-arg default constructor.- Returns:
- The async result with the list of stored items of the given type.
-
storeData
public final AsyncResult<Void> storeData(Object privateData)
Stores private data.- Parameters:
privateData
- The private data. The class of this object must be annotated with JAXB annotations and must known to the XMPP context in order to marshal und unmarshal it.- Returns:
- The async result.
-
-