You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/03/10 07:32:16 UTC

svn commit: r1080118 - in /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry: DefaultEntryAttribute.java EntryAttribute.java

Author: elecharny
Date: Thu Mar 10 06:32:16 2011
New Revision: 1080118

URL: http://svn.apache.org/viewvc?rev=1080118&view=rev
Log:
Removed commented code

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java?rev=1080118&r1=1080117&r2=1080118&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java Thu Mar 10 06:32:16 2011
@@ -562,70 +562,6 @@ public class DefaultEntryAttribute imple
 
     
     /**
-     * Set the Attribute ID. 
-     *
-     * @param id The attribute ID
-     * @throws IllegalArgumentException If the ID is empty or null or
-     * resolve to an empty value after being trimmed
-     *
-    public void setId( String upId )
-    {
-        String newId = Strings.trim( Strings.lowerCaseAscii( upId ) );
-
-        if ( newId.length() == 0 )
-        {
-            throw new IllegalArgumentException( I18n.err( I18n.ERR_04132 ) );
-        }
-        
-        if ( attributeType != null )
-        {
-            if ( attributeType.getName() == null )
-            {
-                // If the name is null, then we may have to store an OID
-                if ( !OID.isOID( newId )  || !attributeType.getOid().equals( newId ) )
-                {
-                    // This is an error
-                    throw new IllegalArgumentException( I18n.err( I18n.ERR_04132 ) );
-                }
-            }
-            else
-            {
-                // We have at least one name. Check that the normalized upId
-                // is one of those names. Otherwise, the upId may be an OID too.
-                // In this case, it must be equals to the attributeType OID.
-                for ( String atName:attributeType.getNames() )
-                {
-                    if ( atName.equalsIgnoreCase( newId ) )
-                    {
-                        // Found ! We can store the upId and get out
-                        this.id = attributeType.getOid();
-                        this.upId = upId;
-                        
-                        // Compute the hashCode
-                        rehash();
-                        
-                        return;
-                    }
-                }
-                
-                // Last case, the UpId is an OID
-                if ( !OID.isOID( newId ) || !attributeType.getOid().equals( newId ) )
-                {
-                    // The id is incorrect : this is not allowed 
-                    throw new IllegalArgumentException( I18n.err( I18n.ERR_04455, id, attributeType.getName() ) );
-                }
-            }
-        }
-
-        this.id = newId;
-        this.upId = upId;
-        
-        // Compute the hashCode
-        rehash();
-    }
-
-    
-    /**
      * Get's the user provided identifier for this entry.  This is the value
      * that will be used as the identifier for the attribute within the
      * entry.  If this is a commonName attribute for example and the user
@@ -2033,89 +1969,6 @@ public class DefaultEntryAttribute imple
     }
     
     
-    /*
-     * Puts some values to this attribute.
-     * <p>
-     * The new values will replace the previous values.
-     * </p>
-     * <p>
-     * This method returns the number of values that were put.
-     * </p>
-     *
-     * @param val some values to be put which may be null
-     * @return the number of added values, or 0 if none has been added
-     *
-    public int put( String... vals )
-    {
-        values.clear();
-        return add( vals );
-    }
-    
-    
-    /**
-     * Puts some values to this attribute.
-     * <p>
-     * The new values will replace the previous values.
-     * </p>
-     * <p>
-     * This method returns the number of values that were put.
-     * </p>
-     *
-     * @param val some values to be put which may be null
-     * @return the number of added values, or 0 if none has been added
-     *
-    public int put( byte[]... vals )
-    {
-        values.clear();
-        return add( vals );
-    }
-
-    
-    /**
-     * Puts some values to this attribute.
-     * <p>
-     * The new values are replace the previous values.
-     * </p>
-     * <p>
-     * This method returns the number of values that were put.
-     * </p>
-     *
-     * @param val some values to be put which may be null
-     * @return the number of added values, or 0 if none has been added
-     *
-    public int put( Value<?>... vals )
-    {
-        values.clear();
-        return add( vals );
-    }
-    
-    
-    /**
-     * <p>
-     * Puts a list of values into this attribute.
-     * </p>
-     * <p>
-     * The new values will replace the previous values.
-     * </p>
-     * <p>
-     * This method returns the number of values that were put.
-     * </p>
-     *
-     * @param vals the values to be put
-     * @return the number of added values, or 0 if none has been added
-     *
-    public int put( List<Value<?>> vals )
-    {
-        values.clear();
-        
-        // Transform the List to an array
-        Value<?>[] valArray = new Value<?>[vals.size()];
-        return add( vals.toArray( valArray ) );
-    }
-    */
-    
-
-
     /**
      * Get the attribute type associated with this ServerAttribute.
      *
@@ -2233,38 +2086,6 @@ public class DefaultEntryAttribute imple
             h = h*17 + id.hashCode();
         }
         
-        /*
-        // We have to sort the values if we wnt to correctly compare two Attributes
-        if ( isHR )
-        {
-            SortedSet<String> sortedSet = new TreeSet<String>();
-
-            for ( Value<?> value:values )
-            {
-                sortedSet.add( (String)value.getNormalizedValueReference() );
-            }
-            
-            for ( String value:sortedSet )
-            {
-                h = h*17 + value.hashCode();
-            }
-        }
-        else
-        {
-            SortedSet<byte[]> sortedSet = new TreeSet<byte[]>();
-            
-            for ( Value<?> value:values )
-            {
-                sortedSet.add( (byte[])value.getNormalizedValueReference() );
-            }
-            
-            for ( byte[] value:sortedSet )
-            {
-                h = h*17 + ArrayUtils.hashCode( value );
-            }
-        }
-        */
-        
         if ( attributeType != null )
         {
             h = h*17 + attributeType.hashCode();

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java?rev=1080118&r1=1080117&r2=1080118&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java Thu Mar 10 06:32:16 2011
@@ -20,8 +20,6 @@ package org.apache.directory.shared.ldap
 
 
 import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
 import java.util.Iterator;
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -243,17 +241,6 @@ public interface EntryAttribute extends 
 
     
     /**
-     * Deserialize an object input.
-     * 
-     * @param in the stream to read data from in order to restore the object
-     * @exception IOException if I/O errors occur
-     * @exception ClassNotFoundException if the class for an object being restored cannot be found.
-     * @see Externalizable#readExternal(ObjectInput)
-     *
-    void deserialize( ObjectInput in ) throws IOException, ClassNotFoundException;
-
-    
-    /**
      * <p>
      * Get the first value of this attribute. If there is none, 
      * null is returned.
@@ -434,17 +421,6 @@ public interface EntryAttribute extends 
 
     
     /**
-     * Set the normalized ID. The ID will be lower cased, and spaces
-     * will be trimmed. 
-     *
-     * @param id The attribute ID
-     * @throws IllegalArgumentException If the ID is empty or null or
-     * resolve to an empty value after being trimmed
-     *
-    void setId( String id ) throws IllegalArgumentException;
-
-    
-    /**
      * Set the user provided ID. It will also set the ID, normalizing
      * the upId (removing spaces before and after, and lower casing it)
      *