directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1071818 - in /directory: apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/ apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/support/ apacheds/branches/m1/core/src/main/java/org/ap...
Date Thu, 17 Feb 2011 22:36:34 GMT
Author: elecharny
Date: Thu Feb 17 22:36:33 2011
New Revision: 1071818

URL: http://svn.apache.org/viewvc?rev=1071818&view=rev
Log:
Renamed the Dn.isChildOf() methods to isDescendantOf() 

Modified:
    directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
    directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
    directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
    directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
    directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
    directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
    directory/shared/branches/m1/integ/src/test/java/org/apache/directory/shared/ldap/name/DnTest.java
    directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
    directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/DnUtils.java

Modified: directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
(original)
+++ directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Thu Feb 17 22:36:33 2011
@@ -177,14 +177,14 @@ public class DefaultAuthorizationInterce
 
         if ( dn.size() > 2 && !isAnAdministrator(principalDn) )
         {
-            if ( dn.isChildOf( ADMIN_SYSTEM_DN ) )
+            if ( dn.isDescendantOf( ADMIN_SYSTEM_DN ) )
             {
                 String msg = I18n.err( I18n.ERR_15, principalDn.getName(), dn.getName() );
                 LOG.error( msg );
                 throw new LdapNoPermissionException( msg );
             }
 
-            if ( dn.isChildOf( GROUP_BASE_DN ) )
+            if ( dn.isDescendantOf( GROUP_BASE_DN ) )
             {
                 String msg = I18n.err( I18n.ERR_16, principalDn.getName(), dn.getName() );
                 LOG.error( msg );
@@ -268,14 +268,14 @@ public class DefaultAuthorizationInterce
 
             if ( dn.size() > 2 )
             {
-                if ( dn.isChildOf( ADMIN_SYSTEM_DN ) )
+                if ( dn.isDescendantOf( ADMIN_SYSTEM_DN ) )
                 {
                     String msg = I18n.err( I18n.ERR_19, principalDn.getName(), dn.getName()
);
                     LOG.error( msg );
                     throw new LdapNoPermissionException( msg );
                 }
 
-                if ( dn.isChildOf( GROUP_BASE_DN ) )
+                if ( dn.isDescendantOf( GROUP_BASE_DN ) )
                 {
                     String msg = I18n.err( I18n.ERR_20, principalDn.getName(), dn.getName()
);
                     LOG.error( msg );
@@ -357,14 +357,14 @@ public class DefaultAuthorizationInterce
             throw new LdapNoPermissionException( msg );
         }
 
-        if ( ( dn.size() > 2 ) && dn.isChildOf( ADMIN_SYSTEM_DN ) && !isAnAdministrator(
principalDn ) )
+        if ( ( dn.size() > 2 ) && dn.isDescendantOf( ADMIN_SYSTEM_DN ) &&
!isAnAdministrator( principalDn ) )
         {
             String msg = I18n.err( I18n.ERR_23, principalDn.getName(), dn.getName() );
             LOG.error( msg );
             throw new LdapNoPermissionException( msg );
         }
 
-        if ( ( dn.size() > 2 ) && dn.isChildOf( GROUP_BASE_DN ) && !isAnAdministrator(
principalDn ) )
+        if ( ( dn.size() > 2 ) && dn.isDescendantOf( GROUP_BASE_DN ) &&
!isAnAdministrator( principalDn ) )
         {
             String msg = I18n.err( I18n.ERR_24, principalDn.getName(), dn.getName() );
             LOG.error( msg );
@@ -395,7 +395,7 @@ public class DefaultAuthorizationInterce
         {
             if ( normalizedDn.size() > 2 )
             {
-                if ( normalizedDn.isChildOf( ADMIN_SYSTEM_DN ) )
+                if ( normalizedDn.isDescendantOf( ADMIN_SYSTEM_DN ) )
                 {
                     // allow for self reads
                     if ( normalizedDn.getNormName().equals( principalDn.getNormName() ) )
@@ -408,7 +408,7 @@ public class DefaultAuthorizationInterce
                     throw new LdapNoPermissionException( msg );
                 }
 
-                if ( normalizedDn.isChildOf( GROUP_BASE_DN ) )
+                if ( normalizedDn.isDescendantOf( GROUP_BASE_DN ) )
                 {
                     // allow for self reads
                     if ( normalizedDn.equals( principalDn ) )
@@ -512,7 +512,7 @@ public class DefaultAuthorizationInterce
             // stuff this if in here instead of up in outer if to prevent
             // constant needless reexecution for all entries in other depths
 
-            if ( dn.isChildOf( ADMIN_SYSTEM_DN ) || dn.isChildOf( GROUP_BASE_DN ) )
+            if ( dn.isDescendantOf( ADMIN_SYSTEM_DN ) || dn.isDescendantOf( GROUP_BASE_DN
) )
             {
                 return false;
             }

Modified: directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
(original)
+++ directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
Thu Feb 17 22:36:33 2011
@@ -111,7 +111,7 @@ public class RelatedUserClassFilter impl
             }
             else if ( userClass == UserClass.PARENT_OF_ENTRY )
             {
-                if ( entryName.isChildOf( userName ) )
+                if ( entryName.isDescendantOf( userName ) )
                 {
                     return true;
                 }

Modified: directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
(original)
+++ directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Thu Feb 17 22:36:33 2011
@@ -302,7 +302,7 @@ public class EventInterceptor extends Ba
             }
 
             // fix for DIRSERVER-1502
-            if ( ( name.equals( base ) || name.isChildOf( base ) )
+            if ( ( name.equals( base ) || name.isDescendantOf( base ) )
                 && evaluator.evaluate( criteria.getFilter(), base, entry ) )
             {
                 selecting.add( registration );

Modified: directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
(original)
+++ directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
Thu Feb 17 22:36:33 2011
@@ -54,13 +54,13 @@ public class ScopeEvaluator implements E
                 return dn.equals( snode.getBaseDn() );
             
             case ONELEVEL:
-                if ( dn.isChildOf( snode.getBaseDn() ) )
+                if ( dn.isDescendantOf( snode.getBaseDn() ) )
                 {
                     return ( snode.getBaseDn().size() + 1 ) == dn.size();
                 }
             
             case SUBTREE:
-                return dn.isChildOf( snode.getBaseDn() );
+                return dn.isDescendantOf( snode.getBaseDn() );
             
             default:
                 throw new LdapInvalidSearchFilterException( I18n.err( I18n.ERR_247 ) );

Modified: directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Thu Feb 17 22:36:33 2011
@@ -1486,7 +1486,7 @@ public class SchemaInterceptor extends B
         check( name, entry );
 
         // Special checks for the MetaSchema branch
-        if ( name.isChildOf(schemaBaseDn) )
+        if ( name.isDescendantOf(schemaBaseDn) )
         {
             // get the schema name
             String schemaName = getSchemaName( name );

Modified: directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
(original)
+++ directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Thu Feb 17 22:36:33 2011
@@ -894,7 +894,7 @@ public class SubentryInterceptor extends
                 Dn apDn = subentryDn.getParent();
 
                 // No need to evaluate the entry if it's not below an AP.
-                if ( dn.isChildOf( apDn ) )
+                if ( dn.isDescendantOf( apDn ) )
                 {
                     Subentry subentry = subentryCache.getSubentry( subentryDn );
                     SubtreeSpecification ss = subentry.getSubtreeSpecification();

Modified: directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
(original)
+++ directory/apacheds/branches/m1/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
Thu Feb 17 22:36:33 2011
@@ -80,7 +80,7 @@ public class SubtreeEvaluator
         Dn subentryBaseDn = apDn;
         subentryBaseDn = subentryBaseDn.addAll( subtree.getBase() );
         
-        if ( !entryDn.isChildOf( subentryBaseDn ) )
+        if ( !entryDn.isDescendantOf( subentryBaseDn ) )
         {
             // The entry Dn is not part of the subtree specification, get out
             return false;
@@ -123,7 +123,7 @@ public class SubtreeEvaluator
             
             for ( Dn chopBeforeDn : subtree.getChopBeforeExclusions() )
             {
-                if ( entryRelativeDn.isChildOf( chopBeforeDn ) )
+                if ( entryRelativeDn.isDescendantOf( chopBeforeDn ) )
                 {
                     return false;
                 }
@@ -131,7 +131,7 @@ public class SubtreeEvaluator
     
             for ( Dn chopAfterDn : subtree.getChopAfterExclusions() )
             {
-                if ( entryRelativeDn.isChildOf( chopAfterDn ) && !chopAfterDn.equals(
entryRelativeDn ) )
+                if ( entryRelativeDn.isDescendantOf( chopAfterDn ) && !chopAfterDn.equals(
entryRelativeDn ) )
                 {
                     return false;
                 }

Modified: directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
(original)
+++ directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
Thu Feb 17 22:36:33 2011
@@ -260,7 +260,7 @@ public class SyncReplSearchListener impl
 
         try
         {
-            if ( !moveContext.getNewSuperior().isChildOf( clientMsgLog.getSearchCriteria().getBase()
) )
+            if ( !moveContext.getNewSuperior().isDescendantOf( clientMsgLog.getSearchCriteria().getBase()
) )
             {
                 sendDeletedEntry( moveContext.getEntry() );
                 return;
@@ -310,7 +310,7 @@ public class SyncReplSearchListener impl
 
         try
         {
-            if ( !moveAndRenameContext.getNewSuperiorDn().isChildOf( clientMsgLog.getSearchCriteria().getBase()
) )
+            if ( !moveAndRenameContext.getNewSuperiorDn().isDescendantOf( clientMsgLog.getSearchCriteria().getBase()
) )
             {
                 sendDeletedEntry( moveAndRenameContext.getEntry() );
                 return;

Modified: directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
(original)
+++ directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
Thu Feb 17 22:36:33 2011
@@ -407,7 +407,7 @@ public abstract class AbstractXdbmPartit
      */
     public final void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext )
throws LdapException
     {
-        if ( moveAndRenameContext.getNewSuperiorDn().isChildOf( moveAndRenameContext.getDn()
) )
+        if ( moveAndRenameContext.getNewSuperiorDn().isDescendantOf( moveAndRenameContext.getDn()
) )
         {
             throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
                 "cannot place an entry below itself" );
@@ -441,7 +441,7 @@ public abstract class AbstractXdbmPartit
      */
     public final void move( MoveOperationContext moveContext ) throws LdapException
     {
-        if ( moveContext.getNewSuperior().isChildOf( moveContext.getDn() ) )
+        if ( moveContext.getNewSuperior().isDescendantOf( moveContext.getDn() ) )
         {
             throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
                 "cannot place an entry below itself" );

Modified: directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/branches/m1/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Thu Feb 17 22:36:33 2011
@@ -1796,7 +1796,7 @@ public abstract class AbstractStore<E, I
          * entry Dn starts with the target Dn.  If it does then we know the
          * aliased target is a relative and we have a perspecitive cycle.
          */
-        if ( aliasDn.isChildOf( normalizedAliasTargetDn ) )
+        if ( aliasDn.isDescendantOf( normalizedAliasTargetDn ) )
         {
             if ( aliasDn.equals( normalizedAliasTargetDn ) )
             {
@@ -1820,7 +1820,7 @@ public abstract class AbstractStore<E, I
          * need to point it out to the user instead of saying the target
          * does not exist when it potentially could outside of this upSuffix.
          */
-        if ( !normalizedAliasTargetDn.isChildOf( suffixDn ) )
+        if ( !normalizedAliasTargetDn.isDescendantOf( suffixDn ) )
         {
             String msg = I18n.err( I18n.ERR_225, suffixDn.getName() );
             LdapAliasDereferencingException e = new LdapAliasDereferencingException( msg
);
@@ -1882,7 +1882,7 @@ public abstract class AbstractStore<E, I
         Dn normalizedAliasTargetParentDn = normalizedAliasTargetDn;
         normalizedAliasTargetParentDn = normalizedAliasTargetParentDn.remove( normalizedAliasTargetDn.size()
- 1 );
 
-        if ( !aliasDn.isChildOf( normalizedAliasTargetParentDn ) )
+        if ( !aliasDn.isDescendantOf( normalizedAliasTargetParentDn ) )
         {
             oneAliasIdx.add( ancestorId, targetId );
         }
@@ -1899,7 +1899,7 @@ public abstract class AbstractStore<E, I
          */
         while ( !ancestorDn.equals( suffixDn ) && null != ancestorId )
         {
-            if ( !normalizedAliasTargetDn.isChildOf( ancestorDn ) )
+            if ( !normalizedAliasTargetDn.isDescendantOf( ancestorDn ) )
             {
                 subAliasIdx.add( ancestorId, targetId );
             }

Modified: directory/shared/branches/m1/integ/src/test/java/org/apache/directory/shared/ldap/name/DnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/integ/src/test/java/org/apache/directory/shared/ldap/name/DnTest.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/shared/branches/m1/integ/src/test/java/org/apache/directory/shared/ldap/name/DnTest.java
(original)
+++ directory/shared/branches/m1/integ/src/test/java/org/apache/directory/shared/ldap/name/DnTest.java
Thu Feb 17 22:36:33 2011
@@ -1057,7 +1057,7 @@ public class DnTest
     public void testDnStartsWithNull() throws LdapException
     {
         Dn dn = new Dn( "a=b, c=d,e = f" );
-        assertEquals( true, dn.isChildOf( (Dn) null ) );
+        assertEquals( true, dn.isDescendantOf( (Dn) null ) );
     }
 
 
@@ -1068,7 +1068,7 @@ public class DnTest
     public void testDnStartsWithEmpty() throws LdapException
     {
         Dn dn = new Dn( "a=b, c=d,e = f" );
-        assertEquals( true, dn.isChildOf( new Dn() ) );
+        assertEquals( true, dn.isDescendantOf( new Dn() ) );
     }
 
 
@@ -1079,7 +1079,7 @@ public class DnTest
     public void testDnStartsWithSimple() throws LdapException
     {
         Dn dn = new Dn( "a=b, c=d,e = f" );
-        assertEquals( true, dn.isChildOf( new Dn( "e=f" ) ) );
+        assertEquals( true, dn.isDescendantOf( new Dn( "e=f" ) ) );
     }
 
 
@@ -1090,7 +1090,7 @@ public class DnTest
     public void testDnStartsWithComplex() throws LdapException
     {
         Dn dn = new Dn( "a=b, c=d,e = f" );
-        assertEquals( true, dn.isChildOf( new Dn( "c =  d, e =  f" ) ) );
+        assertEquals( true, dn.isDescendantOf( new Dn( "c =  d, e =  f" ) ) );
     }
 
 
@@ -1101,7 +1101,7 @@ public class DnTest
     public void testDnStartsWithComplexMixedCase() throws LdapException
     {
         Dn dn = new Dn( "a=b, c=d,e = f" );
-        assertEquals( false, dn.isChildOf( new Dn( "c =  D, E =  f" ) ) );
+        assertEquals( false, dn.isDescendantOf( new Dn( "c =  D, E =  f" ) ) );
     }
 
 
@@ -1112,7 +1112,7 @@ public class DnTest
     public void testDnStartsWithFull() throws LdapException
     {
         Dn dn = new Dn( "a=b, c=d,e = f" );
-        assertEquals( true, dn.isChildOf( new Dn( "a=  b; c =  d, e =  f" ) ) );
+        assertEquals( true, dn.isDescendantOf( new Dn( "a=  b; c =  d, e =  f" ) ) );
     }
 
 
@@ -1123,7 +1123,7 @@ public class DnTest
     public void testDnStartsWithWrong() throws LdapException
     {
         Dn dn = new Dn( "a=b, c=d,e = f" );
-        assertEquals( false, dn.isChildOf( new Dn( "c =  t, e =  f" ) ) );
+        assertEquals( false, dn.isDescendantOf( new Dn( "c =  t, e =  f" ) ) );
     }
 
 
@@ -1557,8 +1557,8 @@ public class DnTest
         assertTrue( name0.isParentOf( name1 ) );
         assertTrue( name0.isParentOf( name2 ) );
         assertTrue( name1.isParentOf( name2 ) );
-        assertTrue( name2.isChildOf( name1 ) );
-        assertTrue( name2.isChildOf( name0 ) );
+        assertTrue( name2.isDescendantOf( name1 ) );
+        assertTrue( name2.isDescendantOf( name0 ) );
         assertNotSame( name2, name3 );
         assertNotSame( name2, name4 );
         assertNotSame( name3, name4 );
@@ -1952,43 +1952,43 @@ public class DnTest
         Dn n8 = new Dn( "cn=HomeDir,cn=John,ou=Marketing" );
 
         // Check with Dn
-        assertTrue( n0.isChildOf( n1 ) );
-        assertTrue( n0.isChildOf( n2 ) );
-        assertTrue( n0.isChildOf( n3 ) );
-        assertTrue( n0.isChildOf( n4 ) );
-        assertTrue( n0.isChildOf( n5 ) );
-
-        assertTrue( !n0.isChildOf( n6 ) );
-        assertTrue( !n0.isChildOf( n7 ) );
-        assertTrue( !n0.isChildOf( n8 ) );
+        assertTrue( n0.isDescendantOf( n1 ) );
+        assertTrue( n0.isDescendantOf( n2 ) );
+        assertTrue( n0.isDescendantOf( n3 ) );
+        assertTrue( n0.isDescendantOf( n4 ) );
+        assertTrue( n0.isDescendantOf( n5 ) );
+
+        assertTrue( !n0.isDescendantOf( n6 ) );
+        assertTrue( !n0.isDescendantOf( n7 ) );
+        assertTrue( !n0.isDescendantOf( n8 ) );
 
         Dn nn0 = new Dn( "cn=zero" );
         Dn nn10 = new Dn( "cn=one,cn=zero" );
         Dn nn210 = new Dn( "cn=two,cn=one,cn=zero" );
         Dn nn3210 = new Dn( "cn=three,cn=two,cn=one,cn=zero" );
 
-        assertTrue( nn0.isChildOf( nn0 ) );
-        assertTrue( nn10.isChildOf( nn0 ) );
-        assertTrue( nn210.isChildOf( nn0 ) );
-        assertTrue( nn3210.isChildOf( nn0 ) );
-
-        assertTrue( nn10.isChildOf( nn10 ) );
-        assertTrue( nn210.isChildOf( nn10 ) );
-        assertTrue( nn3210.isChildOf( nn10 ) );
+        assertTrue( nn0.isDescendantOf( nn0 ) );
+        assertTrue( nn10.isDescendantOf( nn0 ) );
+        assertTrue( nn210.isDescendantOf( nn0 ) );
+        assertTrue( nn3210.isDescendantOf( nn0 ) );
+
+        assertTrue( nn10.isDescendantOf( nn10 ) );
+        assertTrue( nn210.isDescendantOf( nn10 ) );
+        assertTrue( nn3210.isDescendantOf( nn10 ) );
 
-        assertTrue( nn210.isChildOf( nn210 ) );
-        assertTrue( nn3210.isChildOf( nn210 ) );
+        assertTrue( nn210.isDescendantOf( nn210 ) );
+        assertTrue( nn3210.isDescendantOf( nn210 ) );
 
-        assertTrue( nn3210.isChildOf( nn3210 ) );
+        assertTrue( nn3210.isDescendantOf( nn3210 ) );
 
         assertTrue( "Starting Dn fails with ADS Dn",
-            new Dn( "ou=foo,dc=apache,dc=org" ).isChildOf( new Dn( "dc=apache,dc=org" ) )
);
+            new Dn( "ou=foo,dc=apache,dc=org" ).isDescendantOf( new Dn( "dc=apache,dc=org"
) ) );
 
         assertTrue( "Starting Dn fails with Java LdapName",
-            new Dn( "ou=foo,dc=apache,dc=org" ).isChildOf( new Dn( "dc=apache,dc=org" ) )
);
+            new Dn( "ou=foo,dc=apache,dc=org" ).isDescendantOf( new Dn( "dc=apache,dc=org"
) ) );
 
         assertTrue( "Starting Dn fails with Java LdapName",
-            new Dn( "dc=apache,dc=org" ).isChildOf( new Dn( "dc=apache,dc=org" ) ) );
+            new Dn( "dc=apache,dc=org" ).isDescendantOf( new Dn( "dc=apache,dc=org" ) ) );
     }
 
 
@@ -2545,9 +2545,9 @@ public class DnTest
         Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );
 
         assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
-            aName.isChildOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
+            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
         assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
-            aName.isChildOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
+            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
     }
 
 
@@ -3427,7 +3427,7 @@ public class DnTest
 
 
     @Test
-    public void testIsChildOfTrue() throws Exception
+    public void testIsDescendantOfTrue() throws Exception
     {
         Dn dn = new Dn( "ou=example, dc=apache, dc=org" );
         Dn parent1 = new Dn( "ou=example,dc=apache, dc=org" );
@@ -3435,10 +3435,10 @@ public class DnTest
         Dn parent3 = new Dn( "dc=org" );
         Dn notParent = new Dn( "dc=apache, dc=com" );
 
-        assertTrue( dn.isChildOf( parent1 ) );
-        assertTrue( dn.isChildOf( parent2 ) );
-        assertTrue( dn.isChildOf( parent3 ) );
-        assertFalse( notParent.isChildOf( dn ) );
+        assertTrue( dn.isDescendantOf( parent1 ) );
+        assertTrue( dn.isDescendantOf( parent2 ) );
+        assertTrue( dn.isDescendantOf( parent3 ) );
+        assertFalse( notParent.isDescendantOf( dn ) );
     }
 
 

Modified: directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
(original)
+++ directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
Thu Feb 17 22:36:33 2011
@@ -855,7 +855,7 @@ public final class Dn implements Iterabl
             return false;
         }
 
-        return dn.isChildOf( this );
+        return dn.isDescendantOf( this );
     }
 
 
@@ -867,11 +867,11 @@ public final class Dn implements Iterabl
      * @param dn The parent
      * @return true if the current Dn is a child of the given Dn
      */
-    public boolean isChildOf( String dn )
+    public boolean isDescendantOf( String dn )
     {
         try
         {
-            return isChildOf( new Dn( dn ) );
+            return isDescendantOf( new Dn( dn ) );
         }
         catch ( LdapInvalidDnException lide )
         {
@@ -888,7 +888,7 @@ public final class Dn implements Iterabl
      * @param dn The parent
      * @return true if the current Dn is a child of the given Dn
      */
-    public boolean isChildOf( Dn dn )
+    public boolean isDescendantOf( Dn dn )
     {
         if ( ( dn == null ) || dn.isRootDSE() )
         {

Modified: directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/DnUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/DnUtils.java?rev=1071818&r1=1071817&r2=1071818&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/DnUtils.java
(original)
+++ directory/shared/branches/m1/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/DnUtils.java
Thu Feb 17 22:36:33 2011
@@ -780,7 +780,7 @@ public final class DnUtils
     {
         Dn rdn = descendant;
 
-        if ( rdn.isChildOf( ancestor ) )
+        if ( rdn.isDescendantOf( ancestor ) )
         {
             for ( int ii = 0; ii < ancestor.size(); ii++ )
             {



Mime
View raw message