portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r525265 - /portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
Date Tue, 03 Apr 2007 20:33:55 GMT
Author: taylor
Date: Tue Apr  3 13:33:54 2007
New Revision: 525265

URL: http://svn.apache.org/viewvc?view=rev&rev=525265
Log:
https://issues.apache.org/jira/browse/JS2-672
Add createProperty API to the Preferences Provider component

Modified:
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java?view=diff&rev=525265&r1=525264&r2=525265
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
Tue Apr  3 13:33:54 2007
@@ -20,6 +20,7 @@
 import java.util.prefs.Preferences;
 
 import org.apache.jetspeed.prefs.om.Node;
+import org.apache.jetspeed.prefs.om.Property;
 
 /**
  * <p>
@@ -31,17 +32,73 @@
  */
 public interface PreferencesProvider
 {
+    /**
+     * Given the fullpath to a node, retrieve the node associated with the node path
+     * 
+     * @param fullPath the full path to the node such as "/portlet_entity/dp-1/guest/preferences/mypref"
+     * @param nodeType either System or User node type. A value of 0 is User, a value of
1 is System
+     * @return The Preference Node found when found
+     * @throws NodeDoesNotExistException when a node is not found, an exception is thrown
+     */
     Node getNode(String fullPath, int nodeType) throws NodeDoesNotExistException;
 
+    /**
+     * Check for the existence of a node given the full path to the node
+     * 
+     * @param fullPath  the full path to the node such as "/portlet_entity/dp-1/guest/preferences/mypref"
+     * @param nodeType  either System or User node type. A value of 0 is User, a value of
1 is System
+     * @return true if the node exists, false if it does not exist
+     */
     boolean nodeExists(String fullPath, int nodeType);
 
+    /**
+     * Create a preferences node given the following parameters. Will throw an exception
if the node already exists.
+     * 
+     * @param parent the existing parent node of this node to be created
+     * @param nodeName the name of the node, which should be the same value as the last value
of the full path
+     *                 for example when the full path is "/portlet_entity/dp-1", the nodeName
will be "dp-1"
+     * @param nodeType either System or User node type. A value of 0 is User, a value of
1 is System
+     * @param fullPath  the full path to the node such as "/portlet_entity/dp-1/guest/preferences/mypref"
+     * @return the newly created node on success
+     * @throws FailedToCreateNodeException thrown when the node fails to create
+     * @throws NodeAlreadyExistsException thrown when a node already exists at the given
full path
+     */
     Node createNode(Node parent, String nodeName, int nodeType, String fullPath) throws FailedToCreateNodeException,
             NodeAlreadyExistsException;
 
+    /**
+     * Create a property on the given node. 
+     * @param node the node to have a property added to it
+     * @param name the name of the property to add to the node
+     * @param value the value of the property to add to the node
+     * @return the newly created property
+     * @since 2.1.1
+     */
+    Property createProperty(Node node, String name, Object value);
+    
+    /**
+     * Given a parent node, return a flat collection of immediate children of this node
+     * 
+     * @param parentNode the parent node to be searched for children
+     * @return a Java collection of immediate children of this node
+     */
     Collection getChildren(Node parentNode);
 
+    /**
+     * Stores a preference node to the backing preferences persistent storage.
+     * If the node does not exist, it is created. If it does exist, the node 
+     * is updated.
+     * 
+     * @param node the node to be stored.
+     */
     void storeNode(Node node);
 
+    /**
+     * Removes a node from a given parent node, also removing the node from the preferences
persistence store.
+     * 
+     * @param parentNode the parent of the node to be deleted
+     * @param node the node to be deleted
+     */
     void removeNode(Node parentNode, Node node);
 
     /**
@@ -57,5 +114,10 @@
      */
     Collection lookupPreference(String nodeName, String propertyName, String propertyValue);
 
+    /**
+     * Initializes the preferences node
+     * 
+     * @throws Exception
+     */
     void init() throws Exception;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message