directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1084531 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ ap...
Date Wed, 23 Mar 2011 10:41:37 GMT
Author: elecharny
Date: Wed Mar 23 10:41:36 2011
New Revision: 1084531

URL: http://svn.apache.org/viewvc?rev=1084531&view=rev
Log:
o Renamed the isNormalized() method to isSchemaAware()
o Modified the impacted code
o Fixed the failing tests

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDnFactory.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/DnComparator.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UniqueMemberComparator.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
Wed Mar 23 10:41:36 2011
@@ -68,7 +68,7 @@ public final class LdapPrincipal impleme
         this.schemaManager = schemaManager;
         this.dn = dn;
         
-        if ( ! dn.isNormalized() )
+        if ( ! dn.isSchemaAware() )
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_436 ) );
         }
@@ -215,6 +215,6 @@ public final class LdapPrincipal impleme
      */
     public String toString()
     {
-        return (dn.isNormalized() ? "(n)" : "" ) + "['" + dn.getName() + "', '" + Strings.utf8ToString(userPassword)
+"']'";
+        return (dn.isSchemaAware() ? "(n)" : "" ) + "['" + dn.getName() + "', '" + Strings.utf8ToString(userPassword)
+"']'";
     }
 }

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java
(original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java
Wed Mar 23 10:41:36 2011
@@ -34,6 +34,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 
 public class MockOperation implements OperationContext
 {
@@ -41,10 +42,10 @@ public class MockOperation implements Op
     final CoreSession session;
 
 
-    public MockOperation( int count ) throws Exception 
+    public MockOperation( SchemaManager schemaManager, int count ) throws Exception 
     {
         this.count = count;
-        this.session = new MockCoreSession( new LdapPrincipal( null, new Dn(), AuthenticationLevel.STRONG
),
+        this.session = new MockCoreSession( new LdapPrincipal( schemaManager, new Dn( schemaManager
), AuthenticationLevel.STRONG ),
             new MockDirectoryService( count ) );
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDnFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDnFactory.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDnFactory.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDnFactory.java
Wed Mar 23 10:41:36 2011
@@ -113,7 +113,7 @@ public class DefaultDnFactory implements
         }
         else
         {
-            if ( !cachedDn.isNormalized() && ( schemaManager != null ) )
+            if ( !cachedDn.isSchemaAware() && ( schemaManager != null ) )
             {
                 cachedDn.normalize( schemaManager );
             }
@@ -130,7 +130,7 @@ public class DefaultDnFactory implements
         {
             //System.out.println( "Dn '" + cachedDn + "' found in the cache and isNormalized
" + cachedDn.isNormalized() );
             System.out.println( "Dn cache hit - " + hitCount + ", miss - " + missCount +
" and is normalized = "
-                + cachedDn.isNormalized() );
+                + cachedDn.isSchemaAware() );
         }
 
         return cachedDn;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Wed Mar 23 10:41:36 2011
@@ -933,7 +933,7 @@ public class AciAuthorizationInterceptor
         LdapPrincipal principal = session.getEffectivePrincipal();
         Dn principalDn = principal.getDn();
 
-        if ( !principalDn.isNormalized() )
+        if ( !principalDn.isSchemaAware() )
         {
             principalDn.normalize( schemaManager );
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Wed Mar 23 10:41:36 2011
@@ -487,7 +487,7 @@ public class DefaultAuthorizationInterce
         Dn principalDn = opContext.getSession().getEffectivePrincipal().getDn();
         Dn dn = result.getDn();
 
-        if ( !dn.isNormalized() )
+        if ( !dn.isSchemaAware() )
         {
             dn.normalize( opContext.getSession().getDirectoryService().getSchemaManager()
);
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Wed Mar 23 10:41:36 2011
@@ -123,7 +123,7 @@ public class NormalizationInterceptor ex
     {
         Dn dn = deleteContext.getDn();
 
-        if ( !dn.isNormalized() )
+        if ( !dn.isSchemaAware() )
         {
             dn.normalize( schemaManager );
         }
@@ -137,7 +137,7 @@ public class NormalizationInterceptor ex
      */
     public void modify( NextInterceptor nextInterceptor, ModifyOperationContext modifyContext
) throws LdapException
     {
-        if ( !modifyContext.getDn().isNormalized() )
+        if ( !modifyContext.getDn().isSchemaAware() )
         {
             modifyContext.getDn().normalize( schemaManager );
         }
@@ -162,14 +162,14 @@ public class NormalizationInterceptor ex
     {
         // Normalize the new Rdn and the Dn if needed
 
-        if ( !renameContext.getDn().isNormalized() )
+        if ( !renameContext.getDn().isSchemaAware() )
         {
             renameContext.getDn().normalize( schemaManager );
         }
 
         renameContext.getNewRdn().applySchemaManager( schemaManager );
 
-        if ( !renameContext.getNewDn().isNormalized() )
+        if ( !renameContext.getNewDn().isSchemaAware() )
         {
             renameContext.getNewDn().normalize( schemaManager );
         }
@@ -184,22 +184,22 @@ public class NormalizationInterceptor ex
      */
     public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext )
throws LdapException
     {
-        if ( !moveContext.getDn().isNormalized() )
+        if ( !moveContext.getDn().isSchemaAware() )
         {
             moveContext.getDn().normalize( schemaManager );
         }
 
-        if ( !moveContext.getOldSuperior().isNormalized() )
+        if ( !moveContext.getOldSuperior().isSchemaAware() )
         {
             moveContext.getOldSuperior().normalize( schemaManager );
         }
 
-        if ( !moveContext.getNewSuperior().isNormalized() )
+        if ( !moveContext.getNewSuperior().isSchemaAware() )
         {
             moveContext.getNewSuperior().normalize( schemaManager );
         }
 
-        if ( !moveContext.getNewDn().isNormalized() )
+        if ( !moveContext.getNewDn().isSchemaAware() )
         {
             moveContext.getNewDn().normalize( schemaManager );
         }
@@ -225,17 +225,17 @@ public class NormalizationInterceptor ex
             moveAndRenameContext.getNewRdn().applySchemaManager( schemaManager );
         }
 
-        if ( !moveAndRenameContext.getDn().isNormalized() )
+        if ( !moveAndRenameContext.getDn().isSchemaAware() )
         {
             moveAndRenameContext.getDn().normalize( schemaManager );
         }
 
-        if ( !moveAndRenameContext.getNewDn().isNormalized() )
+        if ( !moveAndRenameContext.getNewDn().isSchemaAware() )
         {
             moveAndRenameContext.getNewDn().normalize( schemaManager );
         }
 
-        if ( !moveAndRenameContext.getNewSuperiorDn().isNormalized() )
+        if ( !moveAndRenameContext.getNewSuperiorDn().isSchemaAware() )
         {
             moveAndRenameContext.getNewSuperiorDn().normalize( schemaManager );
         }
@@ -252,7 +252,7 @@ public class NormalizationInterceptor ex
     {
         Dn dn = searchContext.getDn();
 
-        if ( !dn.isNormalized() )
+        if ( !dn.isSchemaAware() )
         {
             dn.normalize( schemaManager );
         }
@@ -354,7 +354,7 @@ public class NormalizationInterceptor ex
      */
     public boolean compare( NextInterceptor next, CompareOperationContext compareContext
) throws LdapException
     {
-        if ( !compareContext.getDn().isNormalized() )
+        if ( !compareContext.getDn().isSchemaAware() )
         {
             compareContext.getDn().normalize( schemaManager );
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Wed Mar 23 10:41:36 2011
@@ -885,7 +885,7 @@ public class DefaultPartitionNexus exten
             throw new LdapNoSuchObjectException();
         }
 
-        if ( !base.isNormalized() )
+        if ( !base.isSchemaAware() )
         {
             base.normalize( schemaManager );
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Wed Mar 23 10:41:36 2011
@@ -651,7 +651,7 @@ public class SchemaInterceptor extends B
         // We also have to check the H/R flag for the filter attributes
         checkFilter( filter );
 
-        String baseNormForm = ( base.isNormalized() ? base.getNormName() : base.getNormName()
);
+        String baseNormForm = ( base.isSchemaAware() ? base.getNormName() : base.getNormName()
);
 
         // Deal with the normal case : searching for a normal value (not subSchemaSubEntry)
         if ( !subschemaSubentryDnNorm.equals( baseNormForm ) )

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java
Wed Mar 23 10:41:36 2011
@@ -66,7 +66,7 @@ public class LdapPrincipalTest
     @Test
     public void testStaticSerializeEmptyLdapPrincipal() throws Exception
     {
-        LdapPrincipal principal = new LdapPrincipal( null );
+        LdapPrincipal principal = new LdapPrincipal( schemaManager );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
@@ -77,7 +77,7 @@ public class LdapPrincipalTest
         byte[] data = baos.toByteArray();
         ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        LdapPrincipal readPrincipal = LdapPrincipalSerializer.deserialize( null, in );
+        LdapPrincipal readPrincipal = LdapPrincipalSerializer.deserialize( schemaManager,
in );
         assertEquals( principal.getAuthenticationLevel(), readPrincipal.getAuthenticationLevel()
);
         assertEquals( principal.getName(), readPrincipal.getName() );
     }
@@ -100,7 +100,7 @@ public class LdapPrincipalTest
         byte[] data = baos.toByteArray();
         ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        LdapPrincipal readPrincipal = LdapPrincipalSerializer.deserialize( null, in );
+        LdapPrincipal readPrincipal = LdapPrincipalSerializer.deserialize( schemaManager,
in );
         assertEquals( principal.getAuthenticationLevel(), readPrincipal.getAuthenticationLevel()
);
         assertEquals( principal.getName(), readPrincipal.getName() );
     }

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
Wed Mar 23 10:41:36 2011
@@ -174,14 +174,14 @@ public class MaxImmSubFilterTest
         tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE,
PROTECTED_ITEMS,
             EMPTY_MICRO_OPERATION_SET, true, 0 ) );
 
-        AciContext aciContext = new AciContext( schemaManager, new MockOperation( 1 ) );
+        AciContext aciContext = new AciContext( schemaManager, new MockOperation( schemaManager,
1 ) );
         aciContext.setEntryDn( ENTRY_NAME );
         aciContext.setAciTuples( tuples );
         aciContext.setEntry( ENTRY );
 
         assertEquals( 1, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
 
-        aciContext = new AciContext( schemaManager, new MockOperation( 3 ) );
+        aciContext = new AciContext( schemaManager, new MockOperation( schemaManager, 3 )
);
         aciContext.setEntryDn( ENTRY_NAME );
         aciContext.setAciTuples( tuples );
         aciContext.setEntry( ENTRY );

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
Wed Mar 23 10:41:36 2011
@@ -154,7 +154,7 @@ public class LdifPartition extends Abstr
             throw new LdapInvalidDnException( msg );
         }
 
-        if ( !suffix.isNormalized() )
+        if ( !suffix.isSchemaAware() )
         {
             suffix.normalize( schemaManager );
         }

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
Wed Mar 23 10:41:36 2011
@@ -122,7 +122,7 @@ public class SingleFileLdifPartition ext
             throw new LdapInvalidDnException( msg );
         }
 
-        if ( !suffix.isNormalized() )
+        if ( !suffix.isSchemaAware() )
         {
             suffix.normalize( schemaManager );
         }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
Wed Mar 23 10:41:36 2011
@@ -1333,7 +1333,7 @@ public class SearchHandler extends LdapR
     private boolean isSubSchemaSubEntrySearch( LdapSession session, SearchRequest req ) throws
Exception
     {
         Dn base = req.getBase();
-        String baseNormForm = ( base.isNormalized() ? base.getNormName() : base.getNormName()
);
+        String baseNormForm = ( base.isSchemaAware() ? base.getNormName() : base.getNormName()
);
 
         DirectoryService ds = session.getCoreSession().getDirectoryService();
         PartitionNexus nexus = ds.getPartitionNexus();

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java
Wed Mar 23 10:41:36 2011
@@ -233,7 +233,7 @@ public class PagedSearchContext
         {
             request.getBase().normalize( schemaManager );
 
-            if ( !previousSearchRequest.getBase().isNormalized() )
+            if ( !previousSearchRequest.getBase().isSchemaAware() )
             {
                 previousSearchRequest.getBase().normalize( schemaManager );
             }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Wed Mar 23 10:41:36 2011
@@ -228,7 +228,7 @@ public abstract class AbstractStore<E, I
     {
         protect( "suffixDn" );
 
-        if ( !suffixDn.isNormalized() )
+        if ( !suffixDn.isSchemaAware() )
         {
             throw new IllegalArgumentException( I18n.err( I18n.ERR_218, suffixDn.getName()
) );
         }
@@ -773,7 +773,7 @@ public abstract class AbstractStore<E, I
     public ID getEntryId( Dn dn ) throws Exception
     {
         // Just to be sure that the Dn is normalized
-        if ( !dn.isNormalized() )
+        if ( !dn.isSchemaAware() )
         {
             dn.normalize( schemaManager );
         }

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
Wed Mar 23 10:41:36 2011
@@ -1788,34 +1788,33 @@ public class DnTest
     /**
      * Class to test for Dn add(String)
      *
-     * @throws Exception
-     *             when something goes wrong
+     * @throws Exception when something goes wrong
      */
     @Test
     public void testAddString() throws Exception
     {
-        Dn name = new Dn();
+        Dn name = new Dn( schemaManager );
         assertEquals( name, new Dn( "" ) );
 
-        Dn name4 = new Dn( "ou=East" );
+        Dn name4 = new Dn( schemaManager, "ou=East" );
 
-        assertTrue( name.isNormalized() );
+        assertTrue( name.isSchemaAware() );
 
         name = name.add( "ou=East" );
 
-        assertTrue( name.isNormalized() );
+        assertTrue( name.isSchemaAware() );
 
         assertEquals( name4, name );
 
-        Dn name3 = new Dn( "ou=Marketing,ou=East" );
+        Dn name3 = new Dn( schemaManager, "ou=Marketing,ou=East" );
         name = name.add( "ou=Marketing" );
         assertEquals( name3, name );
 
-        Dn name2 = new Dn( "cn=John,ou=Marketing,ou=East" );
+        Dn name2 = new Dn( schemaManager, "cn=John,ou=Marketing,ou=East" );
         name = name.add( "cn=John" );
         assertEquals( name2, name );
 
-        Dn name0 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" );
+        Dn name0 = new Dn( schemaManager, "cn=HomeDir,cn=John,ou=Marketing,ou=East" );
         name = name.add( "cn=HomeDir" );
         assertEquals( name0, name );
     }
@@ -1891,7 +1890,7 @@ public class DnTest
 
         Dn two = new Dn( "cn=test,o=acme" );
         assertNotNull( two.getParent() );
-        assertFalse( two.getParent().isNormalized() );
+        assertFalse( two.getParent().isSchemaAware() );
         assertFalse( two.getParent().isEmpty() );
         assertEquals( "o=acme", two.getParent().getName() );
 
@@ -1899,7 +1898,7 @@ public class DnTest
         three.normalize( schemaManager );
         Dn threeParent = three.getParent();
         assertNotNull( threeParent );
-        assertTrue( threeParent.isNormalized() );
+        assertTrue( threeParent.isSchemaAware() );
         assertFalse( threeParent.isEmpty() );
         assertEquals( "dc=example,dc=com", threeParent.getName() );
         assertEquals( 2, threeParent.getRdns().size() );
@@ -1907,7 +1906,7 @@ public class DnTest
         Dn five = new Dn( "uid=user1,ou=sales,ou=users,dc=example,dc=com" );
         Dn fiveParent = five.getParent();
         assertNotNull( fiveParent );
-        assertFalse( fiveParent.isNormalized() );
+        assertFalse( fiveParent.isSchemaAware() );
         assertFalse( fiveParent.isEmpty() );
         assertEquals( "ou=sales,ou=users,dc=example,dc=com", fiveParent.getName() );
         assertEquals( 4, fiveParent.getRdns().size() );
@@ -2937,16 +2936,16 @@ public class DnTest
     public void testNormalize() throws Exception
     {
         Dn dn = new Dn( "ou=system" );
-        assertFalse( dn.isNormalized() );
+        assertFalse( dn.isSchemaAware() );
 
         dn = dn.add( "ou=users" );
-        assertFalse( dn.isNormalized() );
+        assertFalse( dn.isSchemaAware() );
 
         dn.normalize( schemaManager );
-        assertTrue( dn.isNormalized() );
+        assertTrue( dn.isSchemaAware() );
 
         dn = dn.add( "ou=x" );
-        assertTrue( dn.isNormalized() );
+        assertTrue( dn.isSchemaAware() );
 
         assertEquals( "2.5.4.11=x,2.5.4.11=users,2.5.4.11=system", dn.getNormName() );
         assertEquals( "ou=x,ou=users,ou=system", dn.getName() );
@@ -2957,21 +2956,21 @@ public class DnTest
 
         Rdn rdn = new Rdn( "ou=system" );
         dn = new Dn();
-        assertTrue( dn.isNormalized() );
+        assertFalse( dn.isSchemaAware() );
 
         dn = dn.add( rdn );
-        assertFalse( dn.isNormalized() );
+        assertFalse( dn.isSchemaAware() );
 
         dn.normalize( schemaManager );
-        assertTrue( dn.isNormalized() );
+        assertTrue( dn.isSchemaAware() );
 
         Dn anotherDn = new Dn( "ou=x,ou=users" );
 
         dn = dn.addAll( anotherDn );
-        assertTrue( dn.isNormalized() );
+        assertTrue( dn.isSchemaAware() );
 
         dn.normalize( schemaManager );
-        assertTrue( dn.isNormalized() );
+        assertTrue( dn.isSchemaAware() );
     }
 
 

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
Wed Mar 23 10:41:36 2011
@@ -88,7 +88,7 @@ public class MultiThreadedTest
         assertTrue( sharedRdn.isSchemaAware() );
 
         sharedDn.normalize( schemaManager );
-        assertTrue( sharedDn.isNormalized() );
+        assertTrue( sharedDn.isSchemaAware() );
     }
 
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
Wed Mar 23 10:41:36 2011
@@ -545,7 +545,7 @@ public final class DefaultEntry implemen
      */
     private void normalizeDN( Dn dn )
     {
-        if ( !dn.isNormalized() )
+        if ( !dn.isSchemaAware() )
         {
             try
             {
@@ -2766,7 +2766,7 @@ public final class DefaultEntry implemen
         sb.append( "Entry\n" );
         sb.append( "    dn" );
 
-        if ( dn.isNormalized() )
+        if ( dn.isSchemaAware() )
         {
             sb.append( "[n]" );
         }

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=1084531&r1=1084530&r2=1084531&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 10:41:36 2011
@@ -293,7 +293,7 @@ public class Dn implements Iterable<Rdn>
      * @param normName the normalized name
      * @param bytes the name as a byte[]
      */
-    Dn( SchemaManager schemaManager, String upName, String normName, Rdn... rdns )
+    /* No protection */ Dn( SchemaManager schemaManager, String upName, String normName,
Rdn... rdns )
     {
         this.schemaManager = schemaManager;
         
@@ -1179,7 +1179,7 @@ public class Dn implements Iterable<Rdn>
         clonedDn.rdns.addAll( clonedDn.size() - posn, dn.rdns );
 
         // Regenerate the normalized name and the original string
-        if ( clonedDn.isNormalized() && dn.isNormalized() )
+        if ( clonedDn.isSchemaAware() && dn.isSchemaAware() )
         {
             if ( clonedDn.size() != 0 )
             {
@@ -1568,9 +1568,9 @@ public class Dn implements Iterable<Rdn>
      *
      * @return <code>true</code> if the Dn is already normalized.
      */
-    public boolean isNormalized()
+    public boolean isSchemaAware()
     {
-        return normalized;
+        return schemaManager != null;
     }
 
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/DnComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/DnComparator.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/DnComparator.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/DnComparator.java
Wed Mar 23 10:41:36 2011
@@ -86,7 +86,7 @@ public class DnComparator extends LdapCo
         {
             dn = (Dn)obj;
             
-            dn = ( dn.isNormalized() ? dn : dn.normalize( schemaManager ) );
+            dn = ( dn.isSchemaAware() ? dn : dn.normalize( schemaManager ) );
         }
         else if ( obj instanceof String )
         {

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UniqueMemberComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UniqueMemberComparator.java?rev=1084531&r1=1084530&r2=1084531&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UniqueMemberComparator.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UniqueMemberComparator.java
Wed Mar 23 10:41:36 2011
@@ -172,7 +172,7 @@ public class UniqueMemberComparator exte
         {
             dn = (Dn) obj;
 
-            dn = ( dn.isNormalized() ? dn : dn.normalize( schemaManager ) );
+            dn = ( dn.isSchemaAware() ? dn : dn.normalize( schemaManager ) );
         }
         else if ( obj instanceof String )
         {



Mime
View raw message