org.apache.jetspeed.prefs.impl
Class PreferencesImpl

java.lang.Object
  extended by java.util.prefs.Preferences
      extended by java.util.prefs.AbstractPreferences
          extended by org.apache.jetspeed.prefs.impl.PreferencesImpl

public class PreferencesImpl
extends AbstractPreferences

S Preferencesimplementation relying on Jetspeed OJB based persistence plugin.

Author:
David Le Strat

Field Summary
private static org.apache.commons.logging.Log log
          Logger.
private  org.apache.jetspeed.prefs.om.Node node
          The current Node object.
protected static org.apache.jetspeed.prefs.PreferencesProvider prefsProvider
           
static int SYSTEM_NODE_TYPE
          System Preferences node type.
(package private) static PreferencesImpl systemRoot
           
static int USER_NODE_TYPE
          User Preferences node type.
(package private) static PreferencesImpl userRoot
           
 
Fields inherited from class java.util.prefs.AbstractPreferences
lock, newNode
 
Fields inherited from class java.util.prefs.Preferences
MAX_KEY_LENGTH, MAX_NAME_LENGTH, MAX_VALUE_LENGTH
 
Constructor Summary
PreferencesImpl(PreferencesImpl parent, String nodeName, int nodeType)
           Constructs a root node in the underlying datastore if they have not yet been created.
 
Method Summary
 String[] childrenNamesSpi()
           
 AbstractPreferences childSpi(String name)
           
 void flushSpi()
           
 org.apache.jetspeed.prefs.om.Node getNode()
           getNode
 String getSpi(String key)
           
 String[] keysSpi()
           
 void putSpi(String key, String value)
           
 void removeNodeSpi()
           
 void removeSpi(String key)
           
static void setPreferencesProvider(org.apache.jetspeed.prefs.PreferencesProvider prefsProvider)
           setPreferencesProvider
 void syncSpi()
           
 
Methods inherited from class java.util.prefs.AbstractPreferences
absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, exportNode, exportSubtree, flush, get, getBoolean, getByteArray, getChild, getDouble, getFloat, getInt, getLong, isRemoved, isUserNode, keys, name, node, nodeExists, parent, put, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, sync, toString
 
Methods inherited from class java.util.prefs.Preferences
importPreferences, systemNodeForPackage, systemRoot, userNodeForPackage, userRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_NODE_TYPE

public static final int USER_NODE_TYPE
User Preferences node type.

See Also:
Constant Field Values

SYSTEM_NODE_TYPE

public static final int SYSTEM_NODE_TYPE
System Preferences node type.

See Also:
Constant Field Values

node

private org.apache.jetspeed.prefs.om.Node node
The current Node object.


log

private static final org.apache.commons.logging.Log log
Logger.


prefsProvider

protected static org.apache.jetspeed.prefs.PreferencesProvider prefsProvider

systemRoot

static PreferencesImpl systemRoot

userRoot

static PreferencesImpl userRoot
Constructor Detail

PreferencesImpl

public PreferencesImpl(PreferencesImpl parent,
                       String nodeName,
                       int nodeType)
                throws IllegalStateException

Constructs a root node in the underlying datastore if they have not yet been created.

Logs a warning if the underlying datastore is unavailable.

Parameters:
parent - The parent object.
nodeName - The node name.
nodeType - The node type.
Throws:
IllegalStateException
Method Detail

childrenNamesSpi

public String[] childrenNamesSpi()
                          throws BackingStoreException
Specified by:
childrenNamesSpi in class AbstractPreferences
Throws:
BackingStoreException
See Also:
java.util.prefs.Preferences#childrenNamesSpi()

childSpi

public AbstractPreferences childSpi(String name)
Specified by:
childSpi in class AbstractPreferences
See Also:
java.util.prefs.Preferences#childSpi(java.lang.String)

flushSpi

public void flushSpi()
              throws BackingStoreException
Specified by:
flushSpi in class AbstractPreferences
Throws:
BackingStoreException
See Also:
java.util.prefs.Preferences#flushSpi()

getSpi

public String getSpi(String key)
Specified by:
getSpi in class AbstractPreferences
See Also:
java.util.prefs.Preferences#getSpi(java.lang.String)

keysSpi

public String[] keysSpi()
Specified by:
keysSpi in class AbstractPreferences
See Also:
java.util.prefs.Preferences#keysSpi()

putSpi

public void putSpi(String key,
                   String value)
Specified by:
putSpi in class AbstractPreferences
See Also:
java.util.prefs.Preferences#putSpi(java.lang.String, java.lang.String)

removeNodeSpi

public void removeNodeSpi()
                   throws BackingStoreException
Specified by:
removeNodeSpi in class AbstractPreferences
Throws:
BackingStoreException
See Also:
java.util.prefs.Preferences#removeNodeSpi()

removeSpi

public void removeSpi(String key)
Specified by:
removeSpi in class AbstractPreferences
See Also:
java.util.prefs.Preferences#removeSpi(java.lang.String)

syncSpi

public void syncSpi()
             throws BackingStoreException
Specified by:
syncSpi in class AbstractPreferences
Throws:
BackingStoreException
See Also:
java.util.prefs.Preferences#syncSpi()

getNode

public org.apache.jetspeed.prefs.om.Node getNode()

getNode

Returns:

setPreferencesProvider

public static void setPreferencesProvider(org.apache.jetspeed.prefs.PreferencesProvider prefsProvider)

setPreferencesProvider

Sets the org.apache.jetspeed.prefs.PreferencesProvider that will support backing store operations for all PreferencesImpls

Parameters:
prefsProvider -


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.