Jive Messenger 2.2.2 Javadoc

org.jivesoftware.messenger
Class PrivateStorage

java.lang.Object
  extended by org.jivesoftware.messenger.container.BasicModule
      extended by org.jivesoftware.messenger.PrivateStorage
All Implemented Interfaces:
Module

public class PrivateStorage
extends BasicModule

Private storage for user accounts (JEP-0049). It is used by some XMPP systems for saving client settings on the server.

Author:
Iain Shigeoka

Constructor Summary
PrivateStorage()
          Constructs a new PrivateStore instance.
 
Method Summary
 void add(String username, org.dom4j.Element data)
          Stores private data.
 org.dom4j.Element get(String username, org.dom4j.Element data)
          Returns the data stored under a key corresponding to the name and namespace of the given element.
 boolean isEnabled()
          Returns true if private storage is enabled.
 void setEnabled(boolean enabled)
          Sets whether private storage is enabled.
 void start()
          Starts the basic module.
 void stop()
          Stops the basic module.
 
Methods inherited from class org.jivesoftware.messenger.container.BasicModule
destroy, getName, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivateStorage

public PrivateStorage()
Constructs a new PrivateStore instance.

Method Detail

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

public void add(String username,
                org.dom4j.Element data)
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

public org.dom4j.Element get(String username,
                             org.dom4j.Element data)
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.

start

public void start()
           throws IllegalStateException
Description copied from class: BasicModule

Starts the basic module.

Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.

Specified by:
start in interface Module
Overrides:
start in class BasicModule
Throws:
IllegalStateException - If start is called before initialize successfully returns

stop

public void stop()
Description copied from class: BasicModule

Stops the basic module.

Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.

Specified by:
stop in interface Module
Overrides:
stop in class BasicModule

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.