directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r327694 - /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapDN.java
Date Sat, 22 Oct 2005 20:48:21 GMT
Author: elecharny
Date: Sat Oct 22 13:48:17 2005
New Revision: 327694

URL: http://svn.apache.org/viewcvs?rev=327694&view=rev
Log:
Added a member to store the User Provided DN

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapDN.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapDN.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapDN.java?rev=327694&r1=327693&r2=327694&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapDN.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapDN.java
Sat Oct 22 13:48:17 2005
@@ -165,6 +165,9 @@
     /** The RDNs that are elements of the DN */
     private List rdns = new ArrayList(5); 
     
+    /** The user provided name */
+    private String upName;
+    
     /** A null LdapDN */
     public transient static final LdapDN EMPTY_LDAPDN = new LdapDN();
 
@@ -176,6 +179,7 @@
     public LdapDN()
     {
         super();
+        upName = "";
     }
     
     /**
@@ -210,6 +214,7 @@
         }
         
         normalize();
+        upName = string;
     }
     
     /**
@@ -227,8 +232,10 @@
     {
         try
         {
-            DNParser.parse( new String( bytes, "UTF-8" ), rdns );
-            this.string = toString();
+            upName = new String( bytes, "UTF-8" );
+            DNParser.parse( upName, rdns );
+            string = toString();
+             
             normalize();
         }
         catch ( UnsupportedEncodingException uee )
@@ -283,8 +290,8 @@
     }
     
     /**
-     * Return the DN as a String
-     * @return A String representing the DN
+     * Return the normalized DN as a String,
+     * @return A String representing the normalized DN
      */
     public String toString()
     {
@@ -321,7 +328,7 @@
      */
     public String getName()
     {
-        return ( string == null ? "" : string );
+        return ( upName == null ? "" : upName );
     }
 
     /**
@@ -551,6 +558,7 @@
 
         newLdapDN.normalize();
         newLdapDN.string = newLdapDN.toString();
+        newLdapDN.upName = newLdapDN.string;
         
         return newLdapDN;
     }
@@ -591,6 +599,7 @@
 
         newLdapDN.normalize();
         newLdapDN.string = newLdapDN.toString();
+        newLdapDN.upName = newLdapDN.string;
 
         return newLdapDN;
     }
@@ -647,6 +656,8 @@
             // Regenerate the normalized name and the original string
             normalize();
             
+            upName = toString();
+            
             return this;
         }
         else
@@ -672,7 +683,9 @@
         
         rdns.add( 0, newRdn );
         normalize();
-        
+
+        upName = toString();
+
         return this;
     }
 
@@ -708,6 +721,8 @@
         rdns.add( realPos, newRdn );
         normalize();
         
+        upName = toString();
+        
         return this;
     }
 
@@ -742,6 +757,8 @@
         int realPos = size() - posn - 1;
         LdapRDN rdn = (LdapRDN)rdns.remove( realPos );
         normalize();
+        
+        upName = toString();
         
         return rdn;
     }



Mime
View raw message