directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r648921 - in /directory/sandbox/akarasulu/bigbang/shared: ./ asn1-codec/ asn1/ bouncycastle-reduced/ convert/ ldap-constants/ ldap-jndi/ ldap/ ldap/src/main/java/org/apache/directory/shared/ldap/entry/ ldap/src/main/java/org/apache/director...
Date Thu, 17 Apr 2008 02:24:18 GMT
Author: akarasulu
Date: Wed Apr 16 19:23:57 2008
New Revision: 648921

URL: http://svn.apache.org/viewvc?rev=648921&view=rev
Log:
[MERGE] changes from shared bigbang

Added:
    directory/sandbox/akarasulu/bigbang/shared/README.txt
      - copied unchanged from r648919, directory/shared/branches/bigbang/README.txt
    directory/sandbox/akarasulu/bigbang/shared/bouncycastle-reduced/   (props changed)
      - copied from r648919, directory/shared/branches/bigbang/bouncycastle-reduced/
    directory/sandbox/akarasulu/bigbang/shared/bouncycastle-reduced/pom.xml
      - copied unchanged from r648919, directory/shared/branches/bigbang/bouncycastle-reduced/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractEntry.java
      - copied unchanged from r648919, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractEntry.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntry.java
      - copied unchanged from r648919, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntry.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
      - copied unchanged from r648919, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
Modified:
    directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE
    directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientEntry.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ApproximateNode.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/EqualityNode.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
    directory/sandbox/akarasulu/bigbang/shared/pom.xml

Modified: directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE (original)
+++ directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE Wed Apr 16 19:23:57 2008
@@ -21,4 +21,8 @@
 ----------------------------
 svn merge -r 638217:642491 https://svn.apache.org/repos/asf/directory/shared/branches/bigbang .
 
+Wed Apr 16 22:28:41 EDT 2008
+----------------------------
+svn merge -r 642491:648919 https://svn.apache.org/repos/asf/directory/shared/branches/bigbang .
+
 

Modified: directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml Wed Apr 16 19:23:57 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.9-SNAPSHOT</version>
+    <version>0.9.11-SNAPSHOT</version>
   </parent>
   <artifactId>shared-asn1-codec</artifactId>
   <name>Apache Directory MINA ASN.1 Codec Shared</name>

Modified: directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml Wed Apr 16 19:23:57 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.9-SNAPSHOT</version>
+    <version>0.9.11-SNAPSHOT</version>
   </parent>
   <artifactId>shared-asn1</artifactId>
   <name>Apache Directory ASN.1 Shared</name>

Propchange: directory/sandbox/akarasulu/bigbang/shared/bouncycastle-reduced/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Apr 16 19:23:57 2008
@@ -0,0 +1,14 @@
+*.ipr
+.cdtproject
+*.iml
+.deployables
+*.iws
+.wtpmodules
+.settings
+*.log
+target
+.project
+.classpath
+*~
+.fbprefs
+nbproject

Modified: directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml Wed Apr 16 19:23:57 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.9-SNAPSHOT</version>
+    <version>0.9.11-SNAPSHOT</version>
   </parent>
   <artifactId>shared-converter</artifactId>
   <name>Apache Directory Protocol Ldap Converters</name>

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml Wed Apr 16 19:23:57 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.9-SNAPSHOT</version>
+    <version>0.9.11-SNAPSHOT</version>
   </parent>
   <artifactId>shared-ldap-constants</artifactId>
   <name>Apache Directory Protocol Ldap Shared Constants</name>

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml Wed Apr 16 19:23:57 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.9-SNAPSHOT</version>
+    <version>0.9.11-SNAPSHOT</version>
   </parent>
   <artifactId>shared-ldap-jndi</artifactId>
   <name>Apache Directory JNDI Shared</name>

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml Wed Apr 16 19:23:57 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.9-SNAPSHOT</version>
+    <version>0.9.11-SNAPSHOT</version>
   </parent>
   <artifactId>shared-ldap</artifactId>
   <name>Apache Directory Protocol Ldap Shared</name>

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java Wed Apr 16 19:23:57 2008
@@ -20,7 +20,6 @@
 
 
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.AttributeType;
 
 import javax.naming.NamingException;
 
@@ -29,49 +28,109 @@
 
 
 /**
+ * <p>
  * This interface represent a LDAP entry. An LDAP entry contains :
- * - A distinguished name (DN)
- * - A list of attributes
- * 
+ * <li> A distinguished name (DN)</li>
+ * <li> A list of attributes</li>
+ * </p>
+ * <p>
  * The available methods on this object are described in this interface.
- * 
+ * </p>
+ * <p>
  * This interface is used by the serverEntry and clientEntry interfaces.
- *
+ *</p>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface Entry<T extends EntryAttribute> extends Cloneable, Iterable<T>
+public interface Entry extends Cloneable, Iterable<EntryAttribute>
 {
     /**
-     * Removes all the attributes.
+     * Remove all the attributes for this entry. The DN is not reset
      */
     void clear();
 
 
     /**
+     * Clone the current entry
+     */
+    Entry clone();
+
+
+    /**
      * Get this entry's DN.
      *
-     * @return The entry DN
+     * @return The entry's DN
      */
     LdapDN getDn();
 
 
     /**
+     * Tells if an entry as a specific ObjectClass value
+     * 
+     * @param objectClass The ObjectClassw we want to check
+     * @return <code>true</code> if the ObjectClass value is present 
+     * in the ObjectClass attribute
+     */
+    boolean hasObjectClass( String objectClass );
+
+
+    /**
+     * <p>
+     * Returns the attribute with the specified alias. The return value
+     * is <code>null</code> if no match is found.  
+     * </p>
+     * <p>An Attribute with an id different from the supplied alias may 
+     * be returned: for example a call with 'cn' may in some implementations 
+     * return an Attribute whose getId() field returns 'commonName'.
+     * </p>
+     *
+     * @param alias an aliased name of the attribute identifier
+     * @return the attribute associated with the alias
+     */
+    EntryAttribute get( String alias );
+
+
+    /**
+     * <p>
+     * Put some new ClientAttribute using the User Provided ID. 
+     * No value is inserted. 
+     * </p>
+     * <p>
+     * If an existing Attribute is found, it will be replaced by an
+     * empty attribute, and returned to the caller.
+     * </p>
+     * 
+     * @param upIds The user provided IDs of the AttributeTypes to add.
+     * @return A list of replaced Attributes.
+     */
+    List<EntryAttribute> set( String... upIds );
+
+
+    /**
      * Set this entry's DN.
      *
-     * @param dn The LdapdN associated with this entry
+     * @param dn The DN associated with this entry
      */
-    void setDn( LdapDN dn);
+    void setDn( LdapDN dn );
 
 
     /**
      * Returns an enumeration containing the zero or more attributes in the
-     * collection. The behaviour of the enumeration is not specified if the
+     * collection. The behavior of the enumeration is not specified if the
      * attribute collection is changed.
      *
      * @return an enumeration of all contained attributes
      */
-    Iterator<T> iterator();
+    Iterator<EntryAttribute> iterator();
+
+
+    /**
+     * Add some Attributes to the current Entry.
+     *
+     * @param attributes The attributes to add
+     * @throws NamingException If we can't add any of the attributes
+     */
+    void add( EntryAttribute... attributes ) throws NamingException;
 
 
     /**
@@ -80,45 +139,97 @@
      * @param upId The user provided ID of the attribute we want to add 
      * some values to
      * @param values The list of String values to add
-     * @throws NamingException
+     * @throws NamingException If we can't add any of the values
      */
     void add( String upId, String... values ) throws NamingException;
 
-    
+
     /**
      * Add some binary values to the current Entry.
      *
      * @param upId The user provided ID of the attribute we want to add 
      * some values to
      * @param values The list of binary values to add
-     * @throws NamingException
+     * @throws NamingException If we can't add any of the values
      */
     void add( String upId, byte[]... values ) throws NamingException;
 
-    
+
     /**
      * Add some Values to the current Entry.
      *
      * @param upId The user provided ID of the attribute we want to add 
      * some values to
      * @param values The list of Values to add
-     * @throws NamingException
+     * @throws NamingException If we can't add any of the values
      */
     void add( String upId, Value<?>... values ) throws NamingException;
-    
-    
+
+
     /**
-     * Places non-null attributes in the attribute collection. If there is
-     * already an attribute with the same OID as any of the new attributes, 
-     * the old ones are removed from the collection and are returned by this 
-     * method. If there was no attribute with the same OID the return value 
-     * is <code>null</code>.
+     * <p>
+     * Places attributes in the attribute collection. 
+     * </p>
+     * <p>If there is already an attribute with the same ID as any of the 
+     * new attributes, the old ones are removed from the collection and 
+     * are returned by this method. If there was no attribute with the 
+     * same ID the return value is <code>null</code>.
+     *</p>
      *
      * @param attributes the attributes to be put
      * @return the old attributes with the same OID, if exist; otherwise
      *         <code>null</code>
+     * @exception NamingException if the operation fails
+     */
+    List<EntryAttribute> put( EntryAttribute... attributes ) throws NamingException;
+
+
+    /**
+     * <p>
+     * Put an attribute (represented by its ID and some binary values) into an entry. 
+     * </p>
+     * <p> 
+     * If the attribute already exists, the previous attribute will be 
+     * replaced and returned.
+     * </p>
+     *
+     * @param upId The attribute ID
+     * @param values The list of binary values to put. It can be empty.
+     * @return The replaced attribute
+     */
+    EntryAttribute put( String upId, byte[]... values );
+
+
+    /**
+     * <p>
+     * Put an attribute (represented by its ID and some String values) into an entry. 
+     * </p>
+     * <p> 
+     * If the attribute already exists, the previous attribute will be 
+     * replaced and returned.
+     * </p>
+     *
+     * @param upId The attribute ID
+     * @param values The list of String values to put. It can be empty.
+     * @return The replaced attribute
+     */
+    EntryAttribute put( String upId, String... values );
+
+
+    /**
+     * <p>
+     * Put an attribute (represented by its ID and some values) into an entry. 
+     * </p>
+     * <p> 
+     * If the attribute already exists, the previous attribute will be 
+     * replaced and returned.
+     * </p>
+     *
+     * @param upId The attribute ID
+     * @param values The list of values to put. It can be empty.
+     * @return The replaced attribute
      */
-    List<T> put( T... attributes ) throws NamingException;
+    EntryAttribute put( String upId, Value<?>... values );
 
 
     /**
@@ -129,57 +240,162 @@
       * @param attributes the attributes to be removed
       * @return the removed attribute, if exists; otherwise <code>null</code>
       */
-    List<T> remove( T... attributes ) throws NamingException;
+    List<EntryAttribute> remove( EntryAttribute... attributes ) throws NamingException;
 
 
     /**
-     * Checks if an entry contains an attribute with a given value.
+     * <p>
+     * Removes the specified binary values from an attribute.
+     * </p>
+     * <p>
+     * If at least one value is removed, this method returns <code>true</code>.
+     * </p>
+     * <p>
+     * If there is no more value after having removed the values, the attribute
+     * will be removed too.
+     * </p>
+     * <p>
+     * If the attribute does not exist, nothing is done and the method returns 
+     * <code>false</code>
+     * </p> 
+     *
+     * @param upId The attribute ID  
+     * @param attributes the attributes to be removed
+     * @return <code>true</code> if at least a value is removed, <code>false</code>
+     * if not all the values have been removed or if the attribute does not exist. 
+     */
+    boolean remove( String upId, byte[]... values ) throws NamingException;
+
+
+    /**
+     * <p>
+     * Removes the specified String values from an attribute.
+     * </p>
+     * <p>
+     * If at least one value is removed, this method returns <code>true</code>.
+     * </p>
+     * <p>
+     * If there is no more value after havong removed the values, the attribute
+     * will be removed too.
+     * </p>
+     * <p>
+     * If the attribute does not exist, nothing is done and the method returns 
+     * <code>false</code>
+     * </p> 
+     *
+     * @param upId The attribute ID  
+     * @param attributes the attributes to be removed
+     * @return <code>true</code> if at least a value is removed, <code>false</code>
+     * if no values have been removed or if the attribute does not exist. 
+     */
+    boolean remove( String upId, String... values ) throws NamingException;
+
+
+    /**
+     * <p>
+     * Removes the specified values from an attribute.
+     * </p>
+     * <p>
+     * If at least one value is removed, this method returns <code>true</code>.
+     * </p>
+     * <p>
+     * If there is no more value after having removed the values, the attribute
+     * will be removed too.
+     * </p>
+     * <p>
+     * If the attribute does not exist, nothing is done and the method returns 
+     * <code>false</code>
+     * </p> 
+     *
+     * @param upId The attribute ID  
+     * @param attributes the attributes to be removed
+     * @return <code>true</code> if at least a value is removed, <code>false</code>
+     * if not all the values have been removed or if the attribute does not exist. 
+     */
+    boolean remove( String upId, Value<?>... values ) throws NamingException;
+
+
+    /**
+      * <p>
+      * Removes the attribute with the specified alias. 
+      * </p>
+      * <p>
+      * The removed attribute are returned by this method. 
+      * </p>
+      * <p>
+      * If there is no attribute with the specified alias,
+      * the return value is <code>null</code>.
+      * </p>
+      *
+      * @param attributes an aliased name of the attribute to be removed
+      * @return the removed attributes, if any, as a list; otherwise <code>null</code>
+      */
+    List<EntryAttribute> removeAttributes( String... attributes );
+
+
+    /**
+     * <p>
+     * Checks if an entry contains a list of attributes.
+     * </p>
+     * <p>
+     * If the list is null or empty, this method will return <code>true</code>
+     * if the entry has no attribute, <code>false</code> otherwise.
+     * </p>
      *
-     * @param attributeType The Attribute type we are looking for
-     * @param value The searched value
-     * @return <code>true</code> if the value is found within the attribute
+     * @param attributes The Attributes to look for
+     * @return <code>true</code> if all the attributes are found within 
+     * the entry, <code>false</code> if at least one of them is not present.
      * @throws NamingException If the attribute does not exist
      */
-    boolean contains( AttributeType attributeType, Value<?> value ) throws NamingException;
-    
-    
+    boolean contains( EntryAttribute... attributes ) throws NamingException;
+
+
     /**
-     * Checks if an entry contains an attribute with a given value.
+     * Checks if an entry contains an attribute with some binary values.
      *
-     * @param id The Attribute ID we are looking for
-     * @param value The searched value
-     * @return <code>true</code> if the value is found within the attribute
-     * @throws NamingException If the attribute does not exist
+     * @param id The Attribute we are looking for.
+     * @param values The searched values.
+     * @return <code>true</code> if all the values are found within the attribute,
+     * false if at least one value is not present or if the ID is not valid. 
      */
-    boolean contains( String id, Value<?> value ) throws NamingException;
-    
-    
+    boolean contains( String upId, byte[]... values );
+
+
     /**
-     * Checks if an entry contains an attribute with a given value.
+     * Checks if an entry contains an attribute with some String values.
      *
-     * @param id The Attribute ID we are looking for
-     * @param value The searched value
-     * @return <code>true</code> if the value is found within the attribute
-     * @throws NamingException If the attribute does not exist
+     * @param id The Attribute we are looking for.
+     * @param values The searched values.
+     * @return <code>true</code> if all the values are found within the attribute,
+     * false if at least one value is not present or if the ID is not valid. 
      */
-    boolean contains( String id, String value ) throws NamingException;
+    boolean contains( String upId, String... values );
+
 
-    
     /**
-     * Checks if an entry contains an attribute with a given value.
+     * Checks if an entry contains an attribute with some values.
      *
-     * @param id The Attribute ID we are looking for
-     * @param value The searched value
-     * @return <code>true</code> if the value is found within the attribute
-     * @throws NamingException If the attribute does not exist
+     * @param id The Attribute we are looking for.
+     * @param values The searched values.
+     * @return <code>true</code> if all the values are found within the attribute,
+     * false if at least one value is not present or if the ID is not valid. 
      */
-    boolean contains( String id, byte[] value ) throws NamingException;
+    boolean contains( String upId, Value<?>... values );
+
+
+    /**
+     * Checks if an entry contains some specific attributes.
+     *
+     * @param attributes The Attributes to look for.
+     * @return <code>true</code> if the attributes are all found within the entry.
+     */
+    boolean containsAttribute( String... attributes );
 
     
     /**
-      * Returns the number of attributes.
-      *
-      * @return the number of attributes
-      */
+     * Returns the number of attributes.
+     *
+     * @return the number of attributes
+     */
     int size();
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java Wed Apr 16 19:23:57 2008
@@ -19,7 +19,7 @@
  */
 package org.apache.directory.shared.ldap.entry;
 
-import java.io.Serializable;
+import java.io.Externalizable;
 
 import javax.naming.NamingException;
 
@@ -34,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface Value<T> extends Cloneable, Serializable, Comparable<Value<T>>
+public interface Value<T> extends Cloneable, Externalizable, Comparable<Value<T>>
 {
     
     Value<T> clone();

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java Wed Apr 16 19:23:57 2008
@@ -29,6 +29,11 @@
 import org.slf4j.LoggerFactory;
 
 import javax.naming.NamingException;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.util.Arrays;
 
 
@@ -335,6 +340,25 @@
     }
 
 
+    /**
+     * @see Externalizable#readExternal(ObjectInput)
+     */
+    public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
+    {
+        // TODO implement this method
+        return;
+    }
+
+    
+    /**
+     * @see Externalizable#writeExternal(ObjectOutput)
+     */
+    public void writeExternal( ObjectOutput out ) throws IOException
+    {
+        // TODO Implement this method
+    }
+    
+    
     /**
      * Dumps binary in hex with label.
      *

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientEntry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientEntry.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientEntry.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientEntry.java Wed Apr 16 19:23:57 2008
@@ -20,7 +20,6 @@
 
 
 import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.entry.Value;
 
 
 /**
@@ -34,85 +33,4 @@
  */
 public interface ClientEntry extends Entry
 {
-    /**
-     * Returns the attribute with the specified alias. The return value
-     * is <code>null</code> if no match is found.  An Attribute with an id
-     * different from the supplied alias may be returned: for example a call
-     * with 'cn' may in some implementations return a ClientAttribute whose
-     * getId() feild returns 'commonName'.
-     *
-     * @param alias an aliased name of the attribute identifier
-     * @return the attribute associated with the alias
-     */
-    ClientAttribute get( String alias );
-
-
-    /**
-     * Places a new attribute with the supplied alias and value into the
-     * attribute collection. If there is already an attribute associated with
-     * the alias, the old one is removed from the collection and is returned
-     * by this method. If there was no attribute associated with the alias the
-     * return value is <code>null</code>. An attribute with an id different
-     * from the supplied alias may be returned: for example a call with 'cn'
-     * may in some implementations return a ClientAttribute whose getId()
-     * feild returns 'commonName'.
-     *
-     * This method provides a mechanism to put an attribute with a <code>null
-     * </code> value: the value of <code>val</code> may be <code>null</code>.
-     *
-     * @param alias an aliased name of the new attribute to be put
-     * @param val the value of the new attribute to be put
-     * @return the old attribute with associated with the specified alias,
-     * if exists; otherwise <code>null</code>
-     */
-    ClientAttribute put( String alias, Value<?> val );
-
-
-    /**
-     * Places a new attribute with the supplied OID and value into the attribute
-     * collection. If there is already an attribute with the same OID, the old
-     * one is removed from the collection and is returned by this method. If
-     * there was no attribute with the same OID the return value is
-     * <code>null</code>.
-     *
-     * This method provides a mechanism to put an attribute with a
-     * <code>null</code> value: the value of <code>obj</code> may be
-     * <code>null</code>.
-     *
-     * @param alias an aliased name of the new attribute to be put
-     * @param val the value of the new attribute to be put
-     * @return the old attribute with the same identifier, if exists; otherwise
-     *         <code>null</code>
-     */
-    ClientAttribute put( String alias, String val );
-
-
-    /**
-     * Places a new attribute with the supplied OID and value into the attribute
-     * collection. If there is already an attribute with the same OID, the old
-     * one is removed from the collection and is returned by this method. If
-     * there was no attribute with the same OID the return value is
-     * <code>null</code>.
-     *
-     * This method provides a mechanism to put an attribute with a
-     * <code>null</code> value: the value of <code>obj</code> may be
-     * <code>null</code>.
-     *
-     * @param alias an aliased of the new attribute to be put
-     * @param val the value of the new attribute to be put
-     * @return the old attribute with the same identifier, if exists; otherwise
-     *         <code>null</code>
-     */
-    ClientAttribute put( String alias, byte[] val );
-
-
-    /**
-     * Removes the attribute with the specified alias. The removed attribute is
-     * returned by this method. If there is no attribute with the specified OID,
-     * the return value is <code>null</code>.
-     *
-     * @param alias an aliased name of the attribute to be removed
-     * @return the removed attribute, if exists; otherwise <code>null</code>
-     */
-    ClientAttribute remove( String alias );
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java Wed Apr 16 19:23:57 2008
@@ -19,6 +19,11 @@
 package org.apache.directory.shared.ldap.entry.client;
 
 
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.entry.AbstractValue;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -286,6 +291,25 @@
         
         // Test the normalized values
         return this.getNormalizedValue().equals( other.getNormalizedValue() );
+    }
+    
+    
+    /**
+     * @see Externalizable#readExternal(ObjectInput)
+     */
+    public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
+    {
+        // TODO implement this method
+        return;
+    }
+
+    
+    /**
+     * @see Externalizable#writeExternal(ObjectOutput)
+     */
+    public void writeExternal( ObjectOutput out ) throws IOException
+    {
+        // TODO Implement this method
     }
     
     

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java Wed Apr 16 19:23:57 2008
@@ -108,15 +108,9 @@
         {
             for ( Value<?> val:vals )
             {
-                if ( val instanceof ClientStringValue )
-                {
-                    ClientStringValue serverString = ( ClientStringValue ) val;
-                    add( new ClientStringValue( serverString.get() ) );
-                }
-                else if ( val instanceof ClientBinaryValue )
+                if ( ( val instanceof ClientStringValue ) || ( val instanceof ClientBinaryValue ) )
                 {
-                    ClientBinaryValue serverBinary = ( ClientBinaryValue ) val;
-                    add( new ClientBinaryValue( serverBinary.getCopy() ) );
+                    add( val );
                 }
                 else
                 {
@@ -415,6 +409,7 @@
                     values.add( nullBinaryValue );
                     values.add( nullStringValue );
                     nullValueAdded = true;
+                    nbAdded++;
                 }
                 else if ( !isHR )
                 {
@@ -425,6 +420,7 @@
                     if ( !values.contains( nullBinaryValue ) )
                     {
                         values.add( nullBinaryValue );
+                        nbAdded++;
                     }
                     
                 }
@@ -451,6 +447,7 @@
                         // The attribute type will be set to HR
                         isHR = true;
                         values.add( val );
+                        nbAdded++;
                     }
                     else if ( !isHR )
                     {
@@ -459,12 +456,20 @@
                         ClientBinaryValue cbv = new ClientBinaryValue();
                         cbv.set( StringTools.getBytesUtf8( (String)val.get() ) );
                         
-                        values.add( cbv );
+                        if ( !contains( cbv ) )
+                        {
+                            values.add( cbv );
+                            nbAdded++;
+                        }
                     }
                     else
                     {
                         // The attributeType is HR, simply add the value
-                        values.add( val );
+                        if ( !contains( val ) )
+                        {
+                            values.add( val );
+                            nbAdded++;
+                        }
                     }
                 }
                 else
@@ -475,11 +480,16 @@
                         // The attribute type will be set to binary
                         isHR = false;
                         values.add( val );
+                        nbAdded++;
                     }
                     else if ( !isHR )
                     {
-                        // The attributeType is not HR, simply add the value
-                        values.add( val );
+                        // The attributeType is not HR, simply add the value if it does not already exist
+                        if ( !contains( val ) )
+                        {
+                            values.add( val );
+                            nbAdded++;
+                        }
                     }
                     else
                     {
@@ -488,12 +498,14 @@
                         ClientStringValue csv = new ClientStringValue();
                         csv.set( StringTools.utf8ToString( (byte[])val.get() ) );
                         
-                        values.add( csv );
+                        if ( !contains( csv ) )
+                        {
+                            values.add( csv );
+                            nbAdded++;
+                        }
                     }
                 }
             }
-
-            nbAdded++;
         }
 
         // Last, not least, if a nullValue has been added, and if other 
@@ -536,9 +548,13 @@
         {
             for ( String val:vals )
             {
-                if ( add( new ClientStringValue( val ) ) == 1 )
+                // Call the add(Value) method, if not already present
+                if ( !contains( val ) )
                 {
-                    nbAdded++;
+                    if ( add( new ClientStringValue( val ) ) == 1 )
+                    {
+                        nbAdded++;
+                    }
                 }
             }
         }
@@ -618,10 +634,13 @@
                     valString = StringTools.utf8ToString( val );
                 }
                 
-                // Now call the add(Value) method
-                if ( add( new ClientStringValue( valString ) ) == 1 )
+                // Now call the add(Value) method, if not already present
+                if ( !contains( val ) )
                 {
-                    nbAdded++;
+                    if ( add( new ClientStringValue( valString ) ) == 1 )
+                    {
+                        nbAdded++;
+                    }
                 }
             }
         }
@@ -1321,7 +1340,18 @@
         {
             for ( Value<?> value:values )
             {
-                sb.append( "    " ).append( upId ).append( ": " ).append( value ).append( '\n' );
+                sb.append( "    " ).append( upId ).append( ": " );
+                
+                if ( value.isNull() )
+                {
+                    sb.append( "''" );
+                }
+                else
+                {
+                    sb.append( value );
+                }
+                
+                sb.append( '\n' );
             }
         }
         else

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ApproximateNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ApproximateNode.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ApproximateNode.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ApproximateNode.java Wed Apr 16 19:23:57 2008
@@ -26,7 +26,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision: 519266 $
  */
-public class ApproximateNode extends SimpleNode
+public class ApproximateNode extends EqualityNode
 {
     /**
      * Creates a new ApproximateNode object.

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/EqualityNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/EqualityNode.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/EqualityNode.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/EqualityNode.java Wed Apr 16 19:23:57 2008
@@ -53,6 +53,30 @@
 
 
     /**
+     * Creates a new Equality object.
+     * 
+     * @param attribute the attribute name
+     * @param value the value to test for
+     */
+    protected EqualityNode( String attribute, byte[] value, AssertionType assertionType )
+    {
+        super( attribute, value, assertionType );
+    }
+
+
+    /**
+     * Creates a new Equality object.
+     * 
+     * @param attribute the attribute name
+     * @param value the value to test for
+     */
+    protected EqualityNode( String attribute, String value, AssertionType assertionType )
+    {
+        super( attribute, value, assertionType );
+    }
+
+
+    /**
      * @see Object#hashCode()
      */
     public int hashCode()

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java Wed Apr 16 19:23:57 2008
@@ -537,6 +537,15 @@
         assertFalse( attr6.isHR() );
         assertTrue( attr6.contains( new byte[]{'a'} ) );
         assertTrue( attr6.contains( (byte[])null ) );
+        
+        EntryAttribute attr7 = new DefaultClientAttribute( "test" );
+        
+        attr7.add( "a", "b" );
+        assertEquals( 2, attr7.size() );
+        
+        assertEquals( 1, attr7.add( "b", "c" ) );
+        assertEquals( 3, attr7.size() );
+        assertTrue( attr7.contains( "a", "b", "c" ) );
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/shared/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/pom.xml?rev=648921&r1=648920&r2=648921&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/pom.xml Wed Apr 16 19:23:57 2008
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
@@ -17,20 +16,31 @@
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.directory.project</groupId>
     <artifactId>project</artifactId>
-    <version>10-SNAPSHOT</version>
+    <version>10</version>
   </parent>
   <groupId>org.apache.directory.shared</groupId>
   <artifactId>shared-parent</artifactId>
   <name>Apache Directory Shared</name>
   <packaging>pom</packaging>
-  <version>0.9.9-SNAPSHOT</version>
+  <version>0.9.11-SNAPSHOT</version>
+
+  <properties>
+    <projectName>ApacheDS-Shared</projectName>
+    <!--<siteId>apacheds-shared</siteId>-->
+  </properties>
+  
+  <distributionManagement>
+    <site>
+      <id>apache.directory.shared</id>
+      <!--<url>${staging.siteURL}/${siteId}/${version}</url>-->
+      <url>scpexe://vm094.oxylos.org/var/www/html/projects/shared/</url>
+    </site>
+  </distributionManagement>
 
   <issueManagement>
     <system>JIRA</system>
@@ -44,6 +54,7 @@
     <module>ldap-constants</module>
     <module>asn1-codec</module>
     <module>convert</module>
+    <module>bouncycastle-reduced</module>
   </modules>
 
   <dependencyManagement>
@@ -123,25 +134,8 @@
         </plugin>
       </plugins>
     </pluginManagement>
-
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-release-plugin</artifactId>
-        <configuration>
-          <tagBase>https://svn.apache.org/repos/asf/directory/shared/releases</tagBase>
-        </configuration>
-      </plugin>
-    </plugins>
   </build>
 
-  <distributionManagement>
-    <site>
-      <id>apache.directory.shared</id>
-      <url>scpexe://vm094.oxylos.org/var/www/html/projects/shared/</url>
-    </site>
-  </distributionManagement>
-
   <reporting>
     <excludeDefaults>true</excludeDefaults>
     <plugins>
@@ -240,51 +234,10 @@
     </plugins>
   </reporting>
 
-  <profiles>
-    <profile>
-      <id>release</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-gpg-plugin</artifactId>
-            <executions>
-              <execution>
-                <goals><goal>sign</goal></goals>
-              </execution>
-            </executions>
-          </plugin>
-
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-source-plugin</artifactId>
-            <!-- TODO remove this version tag after using TLP pom 9 -->
-            <version>2.0.3</version>
-            <executions>
-              <execution>
-                <id>attach-sources</id>
-                <goals><goal>jar</goal></goals>
-              </execution>
-            </executions>
-          </plugin>
-
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-javadoc-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>attach-javadocs</id>
-                <goals><goal>jar</goal></goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/directory/shared/branches/bigbang</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/directory/shared/branches/bigbang</developerConnection>
+    <url>http://svn.apache.org/viewvc/directory/project/branches/bigbang/shared-parent</url>
   </scm>
 
   <repositories>
@@ -297,6 +250,5 @@
       </releases>
     </repository>
   </repositories>
-  
-</project>
 
+</project>



Mime
View raw message