portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlest...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs PropertyManager.java
Date Sat, 06 Mar 2004 18:32:10 GMT
dlestrat    2004/03/06 10:32:10

  Modified:    components/prefs/src/java/org/apache/jetspeed/prefs
                        PropertyManager.java
  Log:
  Prefs.
  
  Revision  Changes    Path
  1.2       +30 -85    jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/PropertyManager.java
  
  Index: PropertyManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/PropertyManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PropertyManager.java	26 Feb 2004 04:30:46 -0000	1.1
  +++ PropertyManager.java	6 Mar 2004 18:32:10 -0000	1.2
  @@ -15,6 +15,8 @@
   package org.apache.jetspeed.prefs;
   
   import java.util.Collection;
  +import java.util.Map;
  +import java.util.prefs.Preferences;
   
   import org.apache.jetspeed.prefs.impl.PropertyException;
   
  @@ -32,116 +34,59 @@
       /** The name of the service. */
       String SERVICE_NAME = "PropertyManager";
   
  -    /** The name of the property key name property. */
  -    String PROPERTYKEY_NAME = "propertyKeyName";
  -
  -    /** The name of the property key type property. */
  -    String PROPERTYKEY_TYPE = "propertyKeyType";
  -
  -    /**
  -     * <p>Add a property set definition.</p>
  -     * @param propertySetName The property set name.
  -     * @param propertySetType The property set type.
  -     * @throws PropertyException Thrown if the property set
  -     *                           definition already exists.
  -     */
  -    void addPropertySetDef(String propertySetName, short propertySetType) throws PropertyException;
  -
  -    /**
  -     * <p>Get a property set definition id for a specify
  -     * property set name and property set type.</p>
  -     * @param propertySetName The property set definition name to lookup.
  -     * @param propertySetType The property set definition type to lookup.
  -     * @return The property set definition id.
  -     * @throws PropertyException Throwns if no property set definition is found.
  -     */
  -    //int getPropertySetDefIdByType(String propertySetName, short propertySetType) throws
PropertyException;
  -
  -    /**
  -     * <p>Remove a property set definition and all associated
  -     * property keys and values as well as property sets.</p>
  -     * @param propertySetName The property set definition name to remove.
  -     * @param propertySetType The property set definition type to remove.
  -     * @throws PropertyException Thrown if the property set definition
  -     *                           does not exist.
  -     */
  -    void removePropertySetDef(String propertySetName, short propertySetType) throws PropertyException;
  -
  -    /**
  -     * <p>Update a property set definition.</p>
  -     * @param newPropertySetName The new property set name.
  -     * @param oldPropertySetName The old property set name.
  -     * @param propertySetType The property set type.
  -     * @throws PropertyException Thrown if the update fails.
  -     */
  -    void updatePropertySetDef(String newPropertySetName, String oldPropertySetName, short
propertySetType)
  -        throws PropertyException;
  -
  -    /**
  -     * <p>This method returns a collection of property set definition
  -     * name for a given property set type.</p>
  -     * @param propertySetType The property set definition type.
  -     * @return Th e collection of property set definition for the given type.
  -     * @throws PropertyException Thrown if no property set definition is found.
  -     *
  -     */
  -    Collection getAllPropertySetsByType(short propertySetType) throws PropertyException;
  -
       /**
  -     * <p>Add a set of property keys to a property set definition.</p>
  -     * <p>Each Property key should be passed as a map of:</p>
  +     * <p>Add a set of property keys to a {@link Preferences} node.  Only
  +     * keys added to a node can be set on the {@link Preferences} node.</p>
  +     * <p>Property keys should be passed as a map of:</p>
        * <ul>
        *      <li><code>PROPERTYKEY_NAME</code>: The property key name
of type
        *      <code>java.lang.String</code>.</li>
        *      <li><code>PROPERTYKEY_TYPE</code>: The property key type
of type
        *      <code>java.lang.Short</code>.</li>
        * </ul>
  -     * <p>The collection of properties to be added is passed to the method.</p>
  -     * @param propertySetName The property set definition name to add keys to.
  -     * @param propertySetType The property set definition type to add keys to.
  +     * <p>The Map of [PROPERTYKEY_NAME, PROPERTYKEY_TYPE] of properties to be 
  +     * added to the {@link Preferences} is passed to the method.</p>
  +     * <p>The property names associated to a node must be unique.</p>
  +     * @param prefNode The {@link Preferences} node.
        * @param propertyKeys A map property key name / key type.
        * @throws PropertyException Thrown if any property in the
        *                           set in already assigned to a property set
        *                           definition.
        */
  -    void addPropertyKeys(String propertySetName, short propertySetType, Collection propertyKeys)
throws PropertyException;
  -
  -    /**
  -     * <p>Remove all the property keys associated with a specific
  -     * set definition and all values associated to the keys.</p>
  -     * @param propertySetDefId The property set definition id.
  -     * @throws PropertyException Thrown if the property set definition
  -     *                           is not found.
  -     */
  -    //void removePropertyKeysBySetDef(int propertySetDefId) throws PropertyException;
  +    void addPropertyKeys(Preferences prefNode, Map propertyKeysMap) throws PropertyException;
   
       /**
  -     * <p>Retrieve all property keys id/name maps for a property
  -     * set definition.<p>
  -     * @param propertySetName The property set definition name to get the keys from.
  -     * @param propertySetType The property set definition type to get the keys from.
  -     * @return Collection of property keys names.
  -     * @throws PropertyException Throwns if no property set definition is found.
  +     * <p>Returns the property keys available to a {@link Preferences} node whether
  +     * or node those keys have values assigned to them.</p>
  +     * <p>Property keys will be returned as a map of:</p>
  +     * <ul>
  +     *      <li><code>PROPERTYKEY_NAME</code>: The property key name
of type
  +     *      <code>java.lang.String</code>.</li>
  +     *      <li><code>PROPERTYKEY_TYPE</code>: The property key type
of type
  +     *      <code>java.lang.Short</code>.</li>
  +     * </ul>
  +     * @param prefNode The {@link Preferences} node.
  +     * @return The map of property keys names / types.
        */
  -    Collection getPropertyKeysBySetDef(String propertySetName, short propertySetType) throws
PropertyException;
  +    Map getPropertyKeys(Preferences prefNode);
   
       /**
  -     * <p>Remove a property key.  This will remove the property key and
  -     * all property values associated with this key.</p>
  -     * @param propertyKeyId The property key id.
  +     * <p>Remove the specified collection of property keys from the given preferences
node.</p>
  +     * @param prefNode The {@link Preferences} node.
  +     * @param propertyKeys A collection of property key names.
        * @throws PropertyException Throws if delete fails.
        */
  -    void removePropertyKey(int propertyKeyId) throws PropertyException;
  +    void removePropertyKeys(Preferences prefNode, Collection propertyKeys) throws PropertyException;
   
       /**
        * <p>Update a property key.</p>
  -     * @param newPropertyKeyName The new property key name.
        * @param oldPropertyKeyName The old property key name.
  -     * @param propertySetName The property set definition name for which update the key.
  -     * @param propertySetType The property set definition type for which update the key
  +     * @param prefNode The {@link Preferences} node.
  +     * @param newPropertyKey The property key name / type map used to
  +     *                       update the old property.
        * @throws PropertyException Throws if update fails.
        */
  -    void updatePropertyKey(String newPropertyKeyName, String oldPropertyKeyName, String
propertySetName, short propertySetType)
  +    void updatePropertyKey(String oldPropertyKeyName, Preferences prefNode, Map newPropertyKey)
           throws PropertyException;
   
   }
  
  
  

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


Mime
View raw message