directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1084646 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
Date Wed, 23 Mar 2011 17:17:27 GMT
Author: elecharny
Date: Wed Mar 23 17:17:27 2011
New Revision: 1084646

URL: http://svn.apache.org/viewvc?rev=1084646&view=rev
Log:
o Removed the hasSchemaManager() method
o Fixed an issue in the isDescendantOf method

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java?rev=1084646&r1=1084645&r2=1084646&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
Wed Mar 23 17:17:27 2011
@@ -462,30 +462,6 @@ public class Dn implements Iterable<Rdn>
     
     
     /**
-     * Tells if the Dn is schema aware.
-     * 
-     * @return <code>true</code> If the Dn has a schemaManager
-     */
-    public boolean hasSchemaManager()
-    {
-        return schemaManager != null;
-    }
-
-
-    /**
-     * Return the user provided Dn as a String. It returns the same value as the
-     * getName method
-     *
-     * @return A String representing the user provided Dn
-     */
-    @Override
-    public String toString()
-    {
-        return getName();
-    }
-
-
-    /**
      * Return the User Provided Dn as a String,
      *
      * @return A String representing the User Provided Dn
@@ -674,8 +650,14 @@ public class Dn implements Iterable<Rdn>
      * Dn dn = new Dn( schemaManager, "ou = Example , ou = com" );
      * assert( "2.5.4.11=example,2.5.4.11=com".equals( dn.getNormName ) );
      * </pre>
+     * Otherwise, it will return a Dn with the AttributeType in lower case
+     * and the value trimmed : <br/>
+     * <pre>
+     * Dn dn = new Dn( " CN = A   Test " );
+     * assertEquals( "cn=A   Test", dn.getNormName() );
+     * </pre>
      *
-     * @return The Dn as a String
+     * @return The normalized Dn as a String
      */
     public String getNormName()
     {
@@ -769,7 +751,7 @@ public class Dn implements Iterable<Rdn>
     {
         try
         {
-            return isDescendantOf( new Dn( dn ) );
+            return isDescendantOf( new Dn( schemaManager, dn ) );
         }
         catch ( LdapInvalidDnException lide )
         {
@@ -1728,4 +1710,17 @@ public class Dn implements Iterable<Rdn>
         
         out.flush();
     }
+    
+    
+    /**
+     * Return the user provided Dn as a String. It returns the same value as the
+     * getName method
+     *
+     * @return A String representing the user provided Dn
+     */
+    @Override
+    public String toString()
+    {
+        return getName();
+    }
 }



Mime
View raw message