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

svn commit: r951004 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name: AVA.java DN.java RDN.java

Author: seelmann
Date: Thu Jun  3 14:15:10 2010
New Revision: 951004

URL: http://svn.apache.org/viewvc?rev=951004&view=rev
Log:
DN, RDN, and AVA are immutable. Removed unused setters.

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java?rev=951004&r1=951003&r2=951004&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java Thu Jun  3 14:15:10 2010
@@ -285,69 +285,6 @@ public class AVA implements Cloneable, C
 
 
     /**
-     * Store a new type
-     *
-     * @param upType The AVA User Provided type
-     * @param type The AVA type
-     * 
-     * @throws LdapInvalidDnException if the type or upType are empty or null.
-     * If the upName is invalid.
-     */
-    public void setType( String upType, String type ) throws LdapInvalidDnException
-    {
-        if ( StringTools.isEmpty( type ) || StringTools.isEmpty( type.trim() ) )
-        {
-            String message = I18n.err( I18n.ERR_04188 );
-            LOG.error( message );
-            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
-        }
-        
-        if ( StringTools.isEmpty( upType ) || StringTools.isEmpty( upType.trim() ) )
-        {
-            String message = I18n.err( I18n.ERR_04189 );
-            LOG.error( message );
-            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
-        }
-        
-        int equalPosition = upName.indexOf( '=' );
-        
-        if ( equalPosition <= 1 )
-        {
-            String message = I18n.err( I18n.ERR_04190 ); 
-            LOG.error( message );
-            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
-        }
-
-        normType = type.trim().toLowerCase();
-        this.upType = upType;
-        upName = upType + upName.substring( equalPosition );
-        start = -1;
-        length = upName.length();
-    }
-
-
-    /**
-     * Store the type, after having trimmed and lowercased it.
-     *
-     * @param type The AVA type
-     */
-    public void setTypeNormalized( String type ) throws LdapInvalidDnException
-    {
-        if ( StringTools.isEmpty( type ) || StringTools.isEmpty( type.trim() ) )
-        {
-            LOG.error( I18n.err( I18n.ERR_04191 ) );
-            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04191 ) );
-        }
-
-        normType = type.trim().toLowerCase();
-        upType = type;
-        upName = type + upName.substring( upName.indexOf( '=' ) );
-        start = -1;
-        length = upName.length();
-    }
-
-
-    /**
      * Get the Value of a AVA
      *
      * @return The value
@@ -379,22 +316,6 @@ public class AVA implements Cloneable, C
 
 
     /**
-     * Store the value of a AVA.
-     *
-     * @param upValue The user provided value of the AVA
-     * @param normValue The normalized value
-     */
-    public void setValue( Value<?> upValue, Value<?> normValue )
-    {
-        this.normValue = normValue;
-        this.upValue = upValue;
-        upName = upName.substring( 0, upName.indexOf( '=' ) + 1 ) + upValue;
-        start = -1;
-        length = upName.length();
-    }
-
-
-    /**
      * Get the upName length
      *
      * @return the upName length
@@ -428,30 +349,6 @@ public class AVA implements Cloneable, C
 
 
     /**
-     * Store the value of a AVA, after having trimmed it.
-     *
-     * @param value The value of the AVA
-     */
-    public void setValueNormalized( String value )
-    {
-        String newValue = StringTools.trim( value );
-
-        if ( StringTools.isEmpty( newValue ) )
-        {
-            this.normValue = new StringValue( "" );
-        }
-        else
-        {
-            this.normValue = new StringValue( newValue );
-        }
-
-        upName = upName.substring( 0, upName.indexOf( '=' ) + 1 ) + value;
-        start = -1;
-        length = upName.length();
-    }
-
-
-    /**
      * Implements the cloning.
      *
      * @return a clone of this object

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=951004&r1=951003&r2=951004&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java Thu Jun  3 14:15:10 2010
@@ -532,6 +532,8 @@ public class DN implements Cloneable, Se
     /**
      * Sets the up name.
      * 
+     * Package private because DN is immutable, only used by the DN parser.
+     * 
      * @param upName the new up name
      */
     void setUpName( String upName )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java?rev=951004&r1=951003&r2=951004&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java Thu Jun  3 14:15:10 2010
@@ -826,10 +826,13 @@ public class RDN implements Cloneable, C
 
 
     /**
-     * Set the User Provided Name
+     * Set the User Provided Name.
+     * 
+     * Package private because RDN is immutable, only used by the DN parser.
+     * 
      * @param upName the User Provided dame 
      */
-    public void setUpName( String upName )
+    void setUpName( String upName )
     {
         this.upName = upName;
     }