org.apache.jetspeed.prefs.impl
Class PersistenceBrokerPreferencesProvider

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
          extended by org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
              extended by org.apache.jetspeed.prefs.impl.PersistenceBrokerPreferencesProvider
All Implemented Interfaces:
org.apache.jetspeed.prefs.PreferencesProvider, org.springframework.beans.factory.InitializingBean

public class PersistenceBrokerPreferencesProvider
extends org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
implements org.apache.jetspeed.prefs.PreferencesProvider

PersistenceBrokerPreferencesProvider

Version:
$Id: PersistenceBrokerPreferencesProvider.java 605797 2007-12-20 03:39:09Z woonsan $
Author:
Scott T. Weaver

Nested Class Summary
private static class PersistenceBrokerPreferencesProvider.NodeCache
           
 
Field Summary
private  org.apache.jetspeed.cache.JetspeedCache preferenceCache
           
private  List preloadedApplications
           
private  boolean preloadEntities
           
 
Fields inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
repositoryPath
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
PersistenceBrokerPreferencesProvider(String repositoryPath)
           
PersistenceBrokerPreferencesProvider(String repositoryPath, org.apache.jetspeed.cache.JetspeedCache preferenceCache)
           
PersistenceBrokerPreferencesProvider(String repositoryPath, org.apache.jetspeed.cache.JetspeedCache preferenceCache, List apps, boolean preloadEntities)
           
 
Method Summary
protected  void addToCache(PersistenceBrokerPreferencesProvider.NodeCache content)
           
private  Collection cacheChildren(Collection children)
           
 org.apache.jetspeed.prefs.om.Node createNode(org.apache.jetspeed.prefs.om.Node parent, String nodeName, int nodeType, String fullPath)
           
 org.apache.jetspeed.prefs.om.Property createProperty(org.apache.jetspeed.prefs.om.Node node, String name, Object value)
           
 Collection getChildren(org.apache.jetspeed.prefs.om.Node parentNode)
           
private  PersistenceBrokerPreferencesProvider.NodeCache getNode(String cacheKey)
           
 org.apache.jetspeed.prefs.om.Node getNode(String fullPath, int nodeType)
           
 void init()
           
protected  int loadNodeAndAllChildren(String path)
           
 Collection lookupPreference(String nodeName, String propertyName, String propertyValue)
           
 boolean nodeExists(String fullPath, int nodeType)
           
 void preloadAllEntities()
           
 void preloadApplicationPreferences(String portletApplicationName)
           
 void redoNode(NodeImplProxy proxy, String fullPath, int nodeType)
           
 void removeNode(org.apache.jetspeed.prefs.om.Node parentNode, org.apache.jetspeed.prefs.om.Node node)
           
private  Collection resolveChildren(Collection children)
           
 void storeNode(org.apache.jetspeed.prefs.om.Node node)
           
 
Methods inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
checkDaoConfig, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, releasePersistenceBroker, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preferenceCache

private org.apache.jetspeed.cache.JetspeedCache preferenceCache

preloadedApplications

private List preloadedApplications

preloadEntities

private boolean preloadEntities
Constructor Detail

PersistenceBrokerPreferencesProvider

public PersistenceBrokerPreferencesProvider(String repositoryPath)
                                     throws ClassNotFoundException
Parameters:
repositoryPath - Location of repository mapping file. Must be available within the classpath.
Throws:
ClassNotFoundException - if the prefsFactoryImpl argument does not reperesent a Class that exists in the current classPath.

PersistenceBrokerPreferencesProvider

public PersistenceBrokerPreferencesProvider(String repositoryPath,
                                            org.apache.jetspeed.cache.JetspeedCache preferenceCache)
                                     throws ClassNotFoundException
Parameters:
repository - Location of repository mapping file. Must be available within the classpath.
prefsFactoryImpl - java.util.prefs.PreferencesFactory implementation to use.
enablePropertyManager - Whether or not we chould be suing the property manager.
Throws:
ClassNotFoundException - if the prefsFactoryImpl argument does not reperesent a Class that exists in the current classPath.

PersistenceBrokerPreferencesProvider

public PersistenceBrokerPreferencesProvider(String repositoryPath,
                                            org.apache.jetspeed.cache.JetspeedCache preferenceCache,
                                            List apps,
                                            boolean preloadEntities)
                                     throws ClassNotFoundException
Throws:
ClassNotFoundException
Method Detail

addToCache

protected void addToCache(PersistenceBrokerPreferencesProvider.NodeCache content)

getNode

private PersistenceBrokerPreferencesProvider.NodeCache getNode(String cacheKey)

getNode

public org.apache.jetspeed.prefs.om.Node getNode(String fullPath,
                                                 int nodeType)
                                          throws org.apache.jetspeed.prefs.NodeDoesNotExistException
Specified by:
getNode in interface org.apache.jetspeed.prefs.PreferencesProvider
Throws:
org.apache.jetspeed.prefs.NodeDoesNotExistException

redoNode

public void redoNode(NodeImplProxy proxy,
                     String fullPath,
                     int nodeType)
              throws org.apache.jetspeed.prefs.NodeDoesNotExistException
Throws:
org.apache.jetspeed.prefs.NodeDoesNotExistException
See Also:
PreferencesProvider.getNode(java.lang.String, int)

nodeExists

public boolean nodeExists(String fullPath,
                          int nodeType)
Specified by:
nodeExists in interface org.apache.jetspeed.prefs.PreferencesProvider
See Also:
PreferencesProvider.nodeExists(java.lang.String, int)

createNode

public org.apache.jetspeed.prefs.om.Node createNode(org.apache.jetspeed.prefs.om.Node parent,
                                                    String nodeName,
                                                    int nodeType,
                                                    String fullPath)
                                             throws org.apache.jetspeed.prefs.FailedToCreateNodeException,
                                                    org.apache.jetspeed.prefs.NodeAlreadyExistsException
Specified by:
createNode in interface org.apache.jetspeed.prefs.PreferencesProvider
Throws:
org.apache.jetspeed.prefs.FailedToCreateNodeException
org.apache.jetspeed.prefs.NodeAlreadyExistsException
See Also:
PreferencesProvider.createNode(org.apache.jetspeed.prefs.om.Node, java.lang.String, int, java.lang.String)

getChildren

public Collection getChildren(org.apache.jetspeed.prefs.om.Node parentNode)
Specified by:
getChildren in interface org.apache.jetspeed.prefs.PreferencesProvider
See Also:
PreferencesProvider.getChildren(org.apache.jetspeed.prefs.om.Node)

resolveChildren

private Collection resolveChildren(Collection children)

cacheChildren

private Collection cacheChildren(Collection children)

storeNode

public void storeNode(org.apache.jetspeed.prefs.om.Node node)
Specified by:
storeNode in interface org.apache.jetspeed.prefs.PreferencesProvider
See Also:
PreferencesProvider.storeNode(org.apache.jetspeed.prefs.om.Node)

removeNode

public void removeNode(org.apache.jetspeed.prefs.om.Node parentNode,
                       org.apache.jetspeed.prefs.om.Node node)
Specified by:
removeNode in interface org.apache.jetspeed.prefs.PreferencesProvider
See Also:
PreferencesProvider.removeNode(org.apache.jetspeed.prefs.om.Node, org.apache.jetspeed.prefs.om.Node)

lookupPreference

public Collection lookupPreference(String nodeName,
                                   String propertyName,
                                   String propertyValue)
Specified by:
lookupPreference in interface org.apache.jetspeed.prefs.PreferencesProvider
See Also:
PreferencesProvider.lookupPreference(java.lang.String, java.lang.String, java.lang.String)

createProperty

public org.apache.jetspeed.prefs.om.Property createProperty(org.apache.jetspeed.prefs.om.Node node,
                                                            String name,
                                                            Object value)
Specified by:
createProperty in interface org.apache.jetspeed.prefs.PreferencesProvider

init

public void init()
          throws Exception
Specified by:
init in interface org.apache.jetspeed.prefs.PreferencesProvider
Overrides:
init in class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
Throws:
Exception

preloadApplicationPreferences

public void preloadApplicationPreferences(String portletApplicationName)
                                   throws org.apache.jetspeed.prefs.NodeDoesNotExistException
Throws:
org.apache.jetspeed.prefs.NodeDoesNotExistException

loadNodeAndAllChildren

protected int loadNodeAndAllChildren(String path)

preloadAllEntities

public void preloadAllEntities()
                        throws org.apache.jetspeed.prefs.NodeDoesNotExistException
Throws:
org.apache.jetspeed.prefs.NodeDoesNotExistException


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