You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/08/04 19:13:47 UTC

svn commit: r982332 [2/5] - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/ apacheds/trunk/core-api/src/main/java/...

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DNFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DNFactory.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DNFactory.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DNFactory.java Wed Aug  4 17:13:46 2010
@@ -46,7 +46,7 @@ public class DNFactory
     private static final Logger LOG = LoggerFactory.getLogger( DNFactory.class );
 
     private static SchemaManager schemaManager;
-    
+
     // stat counters
     private static int hitCount = 0;
     private static int missCount = 0;
@@ -56,7 +56,7 @@ public class DNFactory
      * searches the cache first for a possible DN value based on the given 'upName' match.
      * If a DN is present in the cache will return it (after normalizing if required)
      * otherwise will create a new DN instance and stores in the cache before returning it
-     * 
+     *
      * Note that the DN cache is maintained by using user provided DN name as key
      *
      * @param dn the upName of the DN
@@ -70,20 +70,20 @@ public class DNFactory
         {
             return null;
         }
-        
+
         if( dn.trim().length() == 0 )
         {
             return DN.EMPTY_DN;
         }
 
         DN cachedDN = DN_CACHE.get( dn );
-        
+
         if ( cachedDN == null )
         {
             LOG.debug( "DN {} not found in the cache, creating", dn );
-            
+
             cachedDN = new DN( dn, schemaManager );
-            
+
             DN_CACHE.put( dn, cachedDN );
             missCount++;
         }
@@ -91,12 +91,12 @@ public class DNFactory
         {
             if ( !cachedDN.isNormalized() && ( schemaManager != null ) )
             {
-                cachedDN.normalize( schemaManager.getNormalizerMapping() );
+                cachedDN.normalize( schemaManager );
             }
-            
+
             hitCount++;
         }
-        
+
         LOG.debug( "DN {} found in the cache", dn );
 //        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 = "
@@ -147,5 +147,5 @@ public class DNFactory
     {
         DNFactory.schemaManager = schemaManager;
     }
-    
+
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Wed Aug  4 17:13:46 2010
@@ -1417,12 +1417,12 @@ public class DefaultDirectoryService imp
         }
 
         DNFactory.setSchemaManager( schemaManager );
-        
+
         // triggers partition to load schema fully from schema partition
         schemaService.initialize();
         schemaService.getSchemaPartition().initialize();
         partitions.add( schemaService.getSchemaPartition() );
-        systemPartition.getSuffix().normalize( schemaManager.getNormalizerMapping() );
+        systemPartition.getSuffix().normalize( schemaManager );
 
         adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
         adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), this );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java Wed Aug  4 17:13:46 2010
@@ -227,7 +227,7 @@ public class DefaultOperationManager imp
         {
             // Normalize the addContext DN
             DN dn = addContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             // We have to deal with the referral first
             directoryService.getReferralManager().lockRead();
@@ -312,7 +312,7 @@ public class DefaultOperationManager imp
         {
             // Normalize the compareContext DN
             DN dn = compareContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             // We have to deal with the referral first
             directoryService.getReferralManager().lockRead();
@@ -392,7 +392,7 @@ public class DefaultOperationManager imp
         {
             // Normalize the deleteContext DN
             DN dn = deleteContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             // We have to deal with the referral first
             directoryService.getReferralManager().lockRead();
@@ -568,7 +568,7 @@ public class DefaultOperationManager imp
         {
             // Normalize the modifyContext DN
             DN dn = modifyContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             ReferralManager referralManager = directoryService.getReferralManager();
 
@@ -659,11 +659,11 @@ public class DefaultOperationManager imp
         {
             // Normalize the moveContext DN
             DN dn = moveContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             // Normalize the moveContext superior DN
             DN newSuperiorDn = moveContext.getNewSuperior();
-            newSuperiorDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            newSuperiorDn.normalize( directoryService.getSchemaManager() );
 
             // We have to deal with the referral first
             directoryService.getReferralManager().lockRead();
@@ -761,7 +761,7 @@ public class DefaultOperationManager imp
         {
             // Normalize the moveAndRenameContext DN
             DN dn = moveAndRenameContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             // We have to deal with the referral first
             directoryService.getReferralManager().lockRead();
@@ -815,7 +815,7 @@ public class DefaultOperationManager imp
             // Now, check the destination
             // Normalize the moveAndRenameContext DN
             DN newSuperiorDn = moveAndRenameContext.getNewSuperiorDn();
-            newSuperiorDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            newSuperiorDn.normalize( directoryService.getSchemaManager() );
 
             // If he parent DN is a referral, or has a referral ancestor, we have to issue a AffectMultipleDsas result
             // as stated by RFC 3296 Section 5.6.2
@@ -865,7 +865,7 @@ public class DefaultOperationManager imp
         {
             // Normalize the renameContext DN
             DN dn = renameContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             // Inject the newDn into the operation context
             // Inject the new DN into the context
@@ -957,7 +957,7 @@ public class DefaultOperationManager imp
         {
             // Normalize the searchContext DN
             DN dn = searchContext.getDn();
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn.normalize( directoryService.getSchemaManager() );
 
             // We have to deal with the referral first
             directoryService.getReferralManager().lockRead();

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=982332&r1=982331&r2=982332&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 Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.authz;
 
@@ -92,7 +92,7 @@ public class AciAuthorizationInterceptor
 {
     /** the logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( AciAuthorizationInterceptor.class );
-    
+
     /** the dedicated logger for ACI */
     private static final Logger ACI_LOG = LoggerFactory.getLogger( Loggers.ACI_LOG.getName() );
 
@@ -256,7 +256,7 @@ public class AciAuthorizationInterceptor
         throws LdapException
     {
         Entry originalEntry = null;
-        
+
         if ( entry instanceof ClonedServerEntry )
         {
             originalEntry = ((ClonedServerEntry)entry).getOriginalEntry();
@@ -265,7 +265,7 @@ public class AciAuthorizationInterceptor
         {
             originalEntry = entry;
         }
-        
+
         EntryAttribute oc = originalEntry.get( OBJECT_CLASS_AT );
 
         /*
@@ -435,7 +435,7 @@ public class AciAuthorizationInterceptor
         if ( isPrincipalAnAdministrator( principalDn ) )
         {
             ACI_LOG.debug( "Addition done by the administartor : no check" );
-            
+
             next.add( addContext );
             tupleCache.subentryAdded( dn, serverEntry );
             groupCache.groupAdded( dn, serverEntry );
@@ -470,7 +470,7 @@ public class AciAuthorizationInterceptor
         entryAciCtx.setMicroOperations( ADD_PERMS );
         entryAciCtx.setAciTuples( tuples );
         entryAciCtx.setEntry( subentry );
-        
+
         engine.checkPermission( entryAciCtx );
 
         // now we must check if attribute type and value scope permission is granted
@@ -616,7 +616,7 @@ public class AciAuthorizationInterceptor
         engine.checkPermission( entryAciContext );
 
         Collection<MicroOperation> perms = null;
-        Entry entryView = ( Entry ) entry.clone();
+        Entry entryView = entry.clone();
 
         for ( Modification mod : mods )
         {
@@ -688,7 +688,7 @@ public class AciAuthorizationInterceptor
              * value of the attribute. However as we do not have that much granularity in our
              * implementation (we consider an Attribute Addition itself a Micro Operation,
              * not the individual Value Additions) we just handle this when the first value of an
-             * attribute is being checked for relevant permissions below. 
+             * attribute is being checked for relevant permissions below.
              */
             entryView = ServerEntryUtils.getTargetEntry( mod, entryView, schemaManager );
 
@@ -705,7 +705,7 @@ public class AciAuthorizationInterceptor
                 aciContext.setAciTuples( tuples );
                 aciContext.setEntry( entry );
                 aciContext.setEntryView( entryView );
-                
+
                 engine.checkPermission( aciContext );
             }
         }
@@ -734,15 +734,15 @@ public class AciAuthorizationInterceptor
         // no checks on the RootDSE
         if ( dn.isRootDSE() )
         {
-            // No need to go down to the stack, if the dn is empty 
-            // It's the rootDSE, and it exists ! 
+            // No need to go down to the stack, if the dn is empty
+            // It's the rootDSE, and it exists !
             return answer;
         }
 
         // TODO - eventually replace this with a check on session.isAnAdministrator()
         LdapPrincipal principal = hasEntryContext.getSession().getEffectivePrincipal();
         DN principalDn = principal.getDN();
-        
+
         if ( isPrincipalAnAdministrator( principalDn ) )
         {
             return answer;
@@ -789,7 +789,7 @@ public class AciAuthorizationInterceptor
     private void checkLookupAccess( LookupOperationContext lookupContext, Entry entry ) throws LdapException
     {
         DN dn = lookupContext.getDn();
-        
+
         // no permissions checks on the RootDSE
         if ( dn.isRootDSE() )
         {
@@ -832,7 +832,7 @@ public class AciAuthorizationInterceptor
                 valueAciContext.setMicroOperations( READ_PERMS );
                 valueAciContext.setAciTuples( tuples );
                 valueAciContext.setEntry( entry );
-                
+
                 engine.checkPermission( valueAciContext );
             }
         }
@@ -852,7 +852,7 @@ public class AciAuthorizationInterceptor
 
         if ( !principalDn.isNormalized() )
         {
-            principalDn.normalize( schemaManager.getNormalizerMapping() );
+            principalDn.normalize( schemaManager );
         }
 
         // Bypass this interceptor if we disabled the AC subsystem or if the principal is the admin
@@ -1196,9 +1196,9 @@ public class AciAuthorizationInterceptor
         aciContext.setEntry( entry );
 
         engine.checkPermission( aciContext );
-        
+
         AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
-        
+
         aciContext = new AciContext( schemaManager, compareContext );
         aciContext.setUserGroupNames( userGroups );
         aciContext.setUserDn( principalDn );
@@ -1330,7 +1330,7 @@ public class AciAuthorizationInterceptor
     {
         public boolean accept( SearchingOperationContext searchContext, ClonedServerEntry entry ) throws Exception
         {
-            DN normName = entry.getDn().normalize( schemaManager.getNormalizerMapping() );
+            DN normName = entry.getDn().normalize( schemaManager );
             return filter( searchContext, normName, entry );
         }
     }

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=982332&r1=982331&r2=982332&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 Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.authz;
 
@@ -262,7 +262,7 @@ public class DefaultAuthorizationInterce
 
         if ( !isAnAdministrator( principalDn ) )
         {
-            // allow self modifications 
+            // allow self modifications
             if ( dn.equals( getPrincipal() ) )
             {
                 return;
@@ -498,7 +498,7 @@ public class DefaultAuthorizationInterce
 
         if ( !dn.isNormalized() )
         {
-            dn.normalize( opContext.getSession().getDirectoryService().getSchemaManager().getNormalizerMapping() );
+            dn.normalize( opContext.getSession().getDirectoryService().getSchemaManager() );
         }
 
         // Admin users gets full access to all entries
@@ -518,7 +518,7 @@ public class DefaultAuthorizationInterce
         // Block off reads to anything under ou=users and ou=groups if not a self read
         if ( dn.size() > 2 )
         {
-            // stuff this if in here instead of up in outer if to prevent 
+            // 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 ) )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.authz;
 
@@ -51,7 +51,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -99,7 +98,7 @@ public class GroupCache
      * Creates a static group cache.
      *
      * @param directoryService the directory service core
-     * @throws LdapException if there are failures on initialization 
+     * @throws LdapException if there are failures on initialization
      */
     public GroupCache( CoreSession session ) throws LdapException
     {
@@ -144,7 +143,7 @@ public class GroupCache
             DN baseDn = DNFactory.create( suffix, schemaManager );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            
+
             SearchOperationContext searchOperationContext = new SearchOperationContext( session,
                 baseDn, filter, ctls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
@@ -155,9 +154,9 @@ public class GroupCache
                 while ( results.next() )
                 {
                     Entry result = results.get();
-                    DN groupDn = result.getDn().normalize( schemaManager.getNormalizerMapping() );
+                    DN groupDn = result.getDn().normalize( schemaManager );
                     EntryAttribute members = getMemberAttribute( result );
-    
+
                     if ( members != null )
                     {
                         Set<String> memberSet = new HashSet<String>( members.size() );
@@ -169,7 +168,7 @@ public class GroupCache
                         LOG.warn( "Found group '{}' without any member or uniqueMember attributes", groupDn.getName() );
                     }
                 }
-    
+
                 results.close();
             }
             catch ( Exception e )
@@ -468,7 +467,7 @@ public class GroupCache
     /**
      * An optimization.  By having this method here we can directly access the group
      * membership information and lookup to see if the principalDn is contained within.
-     * 
+     *
      * @param principalDn the normalized DN of the user to check if they are an admin
      * @return true if the principal is an admin or the admin
      */

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.authz;
 
@@ -124,11 +124,11 @@ public class TupleCache
         for ( String suffix:suffixes )
         {
             DN baseDn = parseNormalized( session.getDirectoryService().getSchemaManager(), suffix );
-            ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT, 
+            ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT,
                 new StringValue( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            
+
             SearchOperationContext searchOperationContext = new SearchOperationContext( session,
                 baseDn, filter, ctls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
@@ -140,20 +140,19 @@ public class TupleCache
                 while ( results.next() )
                 {
                     Entry result = results.get();
-                    DN subentryDn = result.getDn().normalize( session.getDirectoryService().getSchemaManager().
-                            getNormalizerMapping() );
+                    DN subentryDn = result.getDn().normalize( session.getDirectoryService().getSchemaManager() );
                     EntryAttribute aci = result.get( PRESCRIPTIVE_ACI_AT );
-    
+
                     if ( aci == null )
                     {
                         LOG.warn( "Found accessControlSubentry '" + subentryDn + "' without any "
                             + SchemaConstants.PRESCRIPTIVE_ACI_AT );
                         continue;
                     }
-    
+
                     subentryAdded( subentryDn, result );
                 }
-    
+
                 results.close();
             }
             catch ( Exception e )
@@ -164,8 +163,8 @@ public class TupleCache
     }
 
 
-    /** 
-     * Check if the Entry contains a prescriptiveACI 
+    /**
+     * Check if the Entry contains a prescriptiveACI
      */
     private boolean hasPrescriptiveACI( Entry entry ) throws LdapException
     {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.event;
 
@@ -30,7 +30,6 @@ import java.util.concurrent.ThreadPoolEx
 import java.util.concurrent.TimeUnit;
 
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -54,7 +53,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * An {@link Interceptor} based service for notifying {@link 
+ * An {@link Interceptor} based service for notifying {@link
  * DirectoryListener}s of changes to the DIT.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -196,7 +195,7 @@ public class EventInterceptor extends Ba
 
         // Get the modified entry
         Entry alteredEntry = modifyContext.lookup( modifyContext.getDn(), ByPassConstants.LOOKUP_BYPASS );
-        modifyContext.setAlteredEntry( ( ClonedServerEntry ) alteredEntry );
+        modifyContext.setAlteredEntry( alteredEntry );
 
         for ( final RegistrationEntry registration : selecting )
         {
@@ -222,7 +221,7 @@ public class EventInterceptor extends Ba
 
         // Get the modifed entry
         Entry alteredEntry = renameContext.lookup( renameContext.getNewDn(), ByPassConstants.LOOKUP_BYPASS );
-        renameContext.setModifiedEntry( ( ClonedServerEntry ) alteredEntry );
+        renameContext.setModifiedEntry( alteredEntry );
 
         for ( final RegistrationEntry registration : selecting )
         {
@@ -300,7 +299,7 @@ public class EventInterceptor extends Ba
             NotificationCriteria criteria = registration.getCriteria();
 
             DN base = criteria.getBase();
-            
+
             if ( !criteria.getFilter().isSchemaAware() )
             {
                 criteria.getFilter().accept( filterNormalizer );
@@ -337,7 +336,7 @@ public class EventInterceptor extends Ba
          */
         public void addListener( DirectoryListener listener, NotificationCriteria criteria ) throws Exception
         {
-            criteria.getBase().normalize( ds.getSchemaManager().getNormalizerMapping() );
+            criteria.getBase().normalize( ds.getSchemaManager() );
             ExprNode result = ( ExprNode ) criteria.getFilter().accept( filterNormalizer );
             criteria.setFilter( result );
             registrations.add( new RegistrationEntry( listener, criteria ) );

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=982332&r1=982331&r2=982332&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 Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.normalization;
 
@@ -63,9 +63,9 @@ import org.slf4j.LoggerFactory;
  * A name normalization service.  This service makes sure all relative and distinguished
  * names are normalized before calls are made against the respective interface methods
  * on {@link DefaultPartitionNexus}.
- * 
+ *
  * The Filters are also normalized.
- * 
+ *
  * If the RDN AttributeTypes are not present in the entry for an Add request,
  * they will be added.
  *
@@ -84,7 +84,7 @@ public class NormalizationInterceptor ex
 
 
     /**
-     * Initialize the registries, normalizers. 
+     * Initialize the registries, normalizers.
      */
     public void init( DirectoryService directoryService ) throws LdapException
     {
@@ -112,8 +112,8 @@ public class NormalizationInterceptor ex
      */
     public void add( NextInterceptor nextInterceptor, AddOperationContext addContext ) throws LdapException
     {
-        addContext.getDn().normalize( schemaManager.getNormalizerMapping() );
-        addContext.getEntry().getDn().normalize( schemaManager.getNormalizerMapping() );
+        addContext.getDn().normalize( schemaManager );
+        addContext.getEntry().getDn().normalize( schemaManager );
         addRdnAttributesToEntry( addContext.getDn(), addContext.getEntry() );
         nextInterceptor.add( addContext );
     }
@@ -128,7 +128,7 @@ public class NormalizationInterceptor ex
 
         if ( !dn.isNormalized() )
         {
-            dn.normalize( schemaManager.getNormalizerMapping() );
+            dn.normalize( schemaManager );
         }
 
         nextInterceptor.delete( deleteContext );
@@ -142,7 +142,7 @@ public class NormalizationInterceptor ex
     {
         if ( !modifyContext.getDn().isNormalized() )
         {
-            modifyContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+            modifyContext.getDn().normalize( schemaManager );
         }
 
         nextInterceptor.modify( modifyContext );
@@ -155,17 +155,17 @@ public class NormalizationInterceptor ex
     public void rename( NextInterceptor nextInterceptor, RenameOperationContext renameContext ) throws LdapException
     {
         // Normalize the new RDN and the DN if needed
-        
+
         if ( !renameContext.getDn().isNormalized() )
         {
-            renameContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+            renameContext.getDn().normalize( schemaManager );
         }
 
-        renameContext.getNewRdn().normalize( schemaManager.getNormalizerMapping() );
-        
+        renameContext.getNewRdn().normalize( schemaManager );
+
         if ( !renameContext.getNewDn().isNormalized() )
         {
-            renameContext.getNewDn().normalize( schemaManager.getNormalizerMapping() );
+            renameContext.getNewDn().normalize( schemaManager );
         }
 
         // Push to the next interceptor
@@ -180,29 +180,29 @@ public class NormalizationInterceptor ex
     {
         if ( !moveContext.getDn().isNormalized() )
         {
-            moveContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getDn().normalize( schemaManager );
         }
 
         if ( !moveContext.getOldSuperior().isNormalized() )
         {
-            moveContext.getOldSuperior().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getOldSuperior().normalize( schemaManager );
         }
-        
+
         if ( !moveContext.getNewSuperior().isNormalized() )
         {
-            moveContext.getNewSuperior().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getNewSuperior().normalize( schemaManager );
         }
-        
+
         if ( !moveContext.getNewDn().isNormalized() )
         {
-            moveContext.getNewDn().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getNewDn().normalize( schemaManager );
         }
-        
+
         if ( !moveContext.getRdn().isNormalized() )
         {
-            moveContext.getRdn().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getRdn().normalize( schemaManager );
         }
-        
+
         nextInterceptor.move( moveContext );
     }
 
@@ -216,24 +216,24 @@ public class NormalizationInterceptor ex
 
         if ( !moveAndRenameContext.getNewRdn().isNormalized() )
         {
-            moveAndRenameContext.getNewRdn().normalize( schemaManager.getNormalizerMapping() );
+            moveAndRenameContext.getNewRdn().normalize( schemaManager );
         }
-        
+
         if ( !moveAndRenameContext.getDn().isNormalized() )
         {
-            moveAndRenameContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+            moveAndRenameContext.getDn().normalize( schemaManager );
         }
-        
+
         if ( !moveAndRenameContext.getNewDn().isNormalized() )
         {
-            moveAndRenameContext.getNewDn().normalize( schemaManager.getNormalizerMapping() );
+            moveAndRenameContext.getNewDn().normalize( schemaManager );
         }
-        
+
         if ( !moveAndRenameContext.getNewSuperiorDn().isNormalized() )
         {
-            moveAndRenameContext.getNewSuperiorDn().normalize( schemaManager.getNormalizerMapping() );
+            moveAndRenameContext.getNewSuperiorDn().normalize( schemaManager );
         }
-        
+
         nextInterceptor.moveAndRename( moveAndRenameContext );
     }
 
@@ -248,7 +248,7 @@ public class NormalizationInterceptor ex
 
         if ( !dn.isNormalized() )
         {
-            dn.normalize( schemaManager.getNormalizerMapping() );
+            dn.normalize( schemaManager );
         }
 
         ExprNode filter = searchContext.getFilter();
@@ -282,7 +282,7 @@ public class NormalizationInterceptor ex
      */
     public boolean hasEntry( NextInterceptor nextInterceptor, EntryOperationContext hasEntryContext ) throws LdapException
     {
-        hasEntryContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+        hasEntryContext.getDn().normalize( schemaManager );
         return nextInterceptor.hasEntry( hasEntryContext );
     }
 
@@ -293,7 +293,7 @@ public class NormalizationInterceptor ex
     public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
         throws LdapException
     {
-        listContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+        listContext.getDn().normalize( schemaManager );
         return nextInterceptor.list( listContext );
     }
 
@@ -326,7 +326,7 @@ public class NormalizationInterceptor ex
      */
     public Entry lookup( NextInterceptor nextInterceptor, LookupOperationContext lookupContext ) throws LdapException
     {
-        lookupContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+        lookupContext.getDn().normalize( schemaManager );
 
         List<String> attrIds = lookupContext.getAttrsId();
 
@@ -350,21 +350,21 @@ public class NormalizationInterceptor ex
     {
         if ( !compareContext.getDn().isNormalized() )
         {
-            compareContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+            compareContext.getDn().normalize( schemaManager );
         }
 
         // Get the attributeType from the OID
         try
         {
             AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( compareContext.getOid() );
-    
+
             // Translate the value from binary to String if the AT is HR
             if ( attributeType.getSyntax().isHumanReadable() && ( compareContext.getValue().isBinary() ) )
             {
                 String value = compareContext.getValue().getString();
                 compareContext.setValue( new StringValue( value ) );
             }
-            
+
             compareContext.setAttributeType( attributeType );
         }
         catch ( LdapException le )
@@ -381,7 +381,7 @@ public class NormalizationInterceptor ex
      */
     public void bind( NextInterceptor next, BindOperationContext bindContext ) throws LdapException
     {
-        bindContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+        bindContext.getDn().normalize( schemaManager );
         next.bind( bindContext );
     }
 
@@ -415,7 +415,7 @@ public class NormalizationInterceptor ex
                 LOG.warn( message );
 
                 // We don't have this attribute : add it.
-                // Two cases : 
+                // Two cases :
                 // 1) The attribute does not exist
                 if ( !entry.containsAttribute( upId ) )
                 {

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=982332&r1=982331&r2=982332&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 Aug  4 17:13:46 2010
@@ -224,7 +224,7 @@ public class DefaultPartitionNexus exten
 
         // Initialize and normalize the localy used DNs
         DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN );
-        adminDn.normalize( schemaManager.getNormalizerMapping() );
+        adminDn.normalize( schemaManager );
 
         initializeSystemPartition( directoryService );
 
@@ -881,7 +881,7 @@ public class DefaultPartitionNexus exten
 
         if ( !base.isNormalized() )
         {
-            base.normalize( schemaManager.getNormalizerMapping() );
+            base.normalize( schemaManager );
         }
 
         Partition backend = getPartition( base );

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=982332&r1=982331&r2=982332&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 Aug  4 17:13:46 2010
@@ -6,22 +6,20 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.schema;
 
 
-import static org.apache.directory.shared.ldap.constants.PasswordPolicySchemaConstants.PWD_GRACE_USE_TIME_AT;
-
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -55,7 +53,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.controls.CascadeControl;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
-import org.apache.directory.shared.ldap.constants.PasswordPolicySchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.EmptyCursor;
 import org.apache.directory.shared.ldap.cursor.SingletonCursor;
@@ -172,7 +169,7 @@ public class SchemaInterceptor extends B
 
     private static AttributeType MODIFIERS_NAME_ATTRIBUTE_TYPE;
     private static AttributeType MODIFY_TIMESTAMP_ATTRIBUTE_TYPE;
-    
+
 
     /**
      * Initialize the Schema Service
@@ -201,11 +198,11 @@ public class SchemaInterceptor extends B
         // stuff for dealing with subentries (garbage for now)
         Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
         subschemaSubentryDn = DNFactory.create( subschemaSubentry.getString() );
-        subschemaSubentryDn.normalize( schemaManager.getNormalizerMapping() );
+        subschemaSubentryDn.normalize( schemaManager );
         subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
 
         schemaModificationAttributesDN = DNFactory.create( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
-        schemaModificationAttributesDN.normalize( schemaManager.getNormalizerMapping() );
+        schemaModificationAttributesDN.normalize( schemaManager );
 
         computeSuperiors();
 
@@ -215,7 +212,7 @@ public class SchemaInterceptor extends B
 
         MODIFIERS_NAME_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFIERS_NAME_AT );
         MODIFY_TIMESTAMP_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "SchemaInterceptor Initialized !" );
@@ -398,7 +395,7 @@ public class SchemaInterceptor extends B
         return cursor;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -417,7 +414,7 @@ public class SchemaInterceptor extends B
         }
 
         boolean result = next.compare( compareContext );
-        
+
         return result;
     }
 
@@ -590,9 +587,9 @@ public class SchemaInterceptor extends B
                     node.setValue( newValue );
                 }
             }
-            else if ( ( filter instanceof SubstringNode ) || 
-                      ( filter instanceof PresenceNode ) || 
-                      ( filter instanceof AssertionNode ) || 
+            else if ( ( filter instanceof SubstringNode ) ||
+                      ( filter instanceof PresenceNode ) ||
+                      ( filter instanceof AssertionNode ) ||
                       ( filter instanceof ScopeNode ) )
             {
                 // Nothing to do
@@ -891,13 +888,13 @@ public class SchemaInterceptor extends B
 
 
     /**
-     * Given the objectClasses for an entry, this method adds missing ancestors 
+     * Given the objectClasses for an entry, this method adds missing ancestors
      * in the hierarchy except for top which it removes.  This is used for this
      * solution to DIREVE-276.  More information about this solution can be found
      * <a href="http://docs.safehaus.org:8080/x/kBE">here</a>.
-     * 
+     *
      * @param objectClassAttr the objectClass attribute to modify
-     * @throws Exception if there are problems 
+     * @throws Exception if there are problems
      */
     private void alterObjectClasses( EntryAttribute objectClassAttr ) throws LdapException
     {
@@ -988,7 +985,7 @@ public class SchemaInterceptor extends B
                 }
             }
         }
-        
+
         for ( AVA atav : newRdn )
         {
             AttributeType type = schemaManager.lookupAttributeTypeRegistry( atav.getUpType() );
@@ -1037,7 +1034,7 @@ public class SchemaInterceptor extends B
         // - The value is syntaxically correct
         //
         // While doing that, we will apply the modification to a copy of the current entry
-        Entry tempEntry = ( Entry ) currentEntry.clone();
+        Entry tempEntry = currentEntry.clone();
 
         // Now, apply each mod one by one
         for ( Modification mod : mods )
@@ -1047,7 +1044,7 @@ public class SchemaInterceptor extends B
 
             // We don't allow modification of operational attributes
             if ( !attributeType.isUserModifiable()
-                && ( !attributeType.equals( MODIFIERS_NAME_ATTRIBUTE_TYPE ) 
+                && ( !attributeType.equals( MODIFIERS_NAME_ATTRIBUTE_TYPE )
                 && ( !attributeType.equals( MODIFY_TIMESTAMP_ATTRIBUTE_TYPE ) )
                 && ( !PWD_POLICY_STATE_ATTRIBUTE_TYPES.contains( attributeType ) ) ) )
             {
@@ -1077,11 +1074,11 @@ public class SchemaInterceptor extends B
                         for ( Value<?> value : attribute )
                         {
                             // At this point, we know that the attribute's syntax is correct
-                            // We just have to check that the current attribute does not 
+                            // We just have to check that the current attribute does not
                             // contains the value already
                             if ( currentAttribute.contains( value ) )
                             {
-                                // This is an error. 
+                                // This is an error.
                                 String msg = I18n.err( I18n.ERR_54, value );
                                 LOG.error( msg );
                                 throw new LdapAttributeInUseException( msg );
@@ -1093,7 +1090,7 @@ public class SchemaInterceptor extends B
                     else
                     {
                         // We don't check if the attribute is not in the MUST or MAY at this
-                        // point, as one of the following modification can change the 
+                        // point, as one of the following modification can change the
                         // ObjectClasses.
                         EntryAttribute newAttribute = createNewAttribute( attribute );
 
@@ -1190,7 +1187,7 @@ public class SchemaInterceptor extends B
             }
         }
 
-        // Ok, we have created the modified entry. We now have to check that it's a valid 
+        // Ok, we have created the modified entry. We now have to check that it's a valid
         // entry wrt the schema.
         // We have to check that :
         // - the rdn values are present in the entry
@@ -1351,7 +1348,7 @@ public class SchemaInterceptor extends B
         }
     }
 
-    
+
     /**
      * Filters objectClass attribute to inject top when not present.
      */
@@ -1367,7 +1364,7 @@ public class SchemaInterceptor extends B
 
     /**
      * Check that all the attributes exist in the schema for this entry.
-     * 
+     *
      * We also check the syntaxes
      */
     private void check( DN dn, Entry entry ) throws LdapException
@@ -1659,7 +1656,7 @@ public class SchemaInterceptor extends B
         Set<ObjectClass> structuralObjectClasses = new HashSet<ObjectClass>();
 
         /*
-         * Since the number of ocs present in an entry is small it's not 
+         * Since the number of ocs present in an entry is small it's not
          * so expensive to take two passes while determining correctness
          * since it will result in clear simple code instead of a deep nasty
          * for loop with nested loops.  Plus after the first pass we can
@@ -1691,7 +1688,7 @@ public class SchemaInterceptor extends B
         // --------------------------------------------------------------------
         // Put all structural object classes into new remaining container and
         // start removing any which are superiors of others in the set.  What
-        // is left in the remaining set will be unrelated structural 
+        // is left in the remaining set will be unrelated structural
         /// objectClasses.  If there is more than one then we have a problem.
         // --------------------------------------------------------------------
 
@@ -1783,7 +1780,7 @@ public class SchemaInterceptor extends B
 
     /**
      * Check a String attribute to see if there is some byte[] value in it.
-     * 
+     *
      * If this is the case, try to change it to a String value.
      */
     private boolean checkHumanReadable( EntryAttribute attribute ) throws LdapException
@@ -1825,7 +1822,7 @@ public class SchemaInterceptor extends B
 
     /**
      * Check a binary attribute to see if there is some String value in it.
-     * 
+     *
      * If this is the case, try to change it to a binary value.
      */
     private boolean checkNotHumanReadable( EntryAttribute attribute ) throws LdapException
@@ -1902,7 +1899,7 @@ public class SchemaInterceptor extends B
             {
                 if ( clonedEntry == null )
                 {
-                    clonedEntry = ( Entry ) entry.clone();
+                    clonedEntry = entry.clone();
                 }
 
                 // Switch the attributes

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Wed Aug  4 17:13:46 2010
@@ -1228,7 +1228,7 @@ public class SubentryInterceptor extends
             baseDn = baseDn.addAll( ss.getBase() );
             DN newName = newSuperiorDn;
             newName = newName.add( oldDn.getRdn() );
-            newName.normalize( schemaManager.getNormalizerMapping() );
+            newName.normalize( schemaManager );
 
             subentryCache.addSubentry( newName, subentry );
 
@@ -1255,7 +1255,7 @@ public class SubentryInterceptor extends
                 {
                     Entry candidate = subentries.get();
                     DN dn = candidate.getDn();
-                    dn.normalize( schemaManager.getNormalizerMapping() );
+                    dn.normalize( schemaManager );
 
                     if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                     {
@@ -1320,7 +1320,7 @@ public class SubentryInterceptor extends
             DN newName = newSuperiorDn.getParent();
 
             newName = newName.add( moveAndRenameContext.getNewRdn() );
-            newName.normalize( schemaManager.getNormalizerMapping() );
+            newName.normalize( schemaManager );
 
             subentryCache.addSubentry( newName, subentry );
 
@@ -1346,7 +1346,7 @@ public class SubentryInterceptor extends
                 {
                     Entry candidate = subentries.get();
                     DN dn = candidate.getDn();
-                    dn.normalize( schemaManager.getNormalizerMapping() );
+                    dn.normalize( schemaManager );
 
                     if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                     {
@@ -1403,7 +1403,7 @@ public class SubentryInterceptor extends
             DN newName = oldDn.getParent();
 
             newName = newName.add( renameContext.getNewRdn() );
-            newName.normalize( schemaManager.getNormalizerMapping() );
+            newName.normalize( schemaManager );
 
             subentryCache.addSubentry( newName, subentry );
             next.rename( renameContext );
@@ -1427,7 +1427,7 @@ public class SubentryInterceptor extends
                 {
                     Entry candidate = subentries.get();
                     DN dn = candidate.getDn();
-                    dn.normalize( schemaManager.getNormalizerMapping() );
+                    dn.normalize( schemaManager );
 
                     if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                     {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.trigger;
 
@@ -107,7 +107,7 @@ public class TriggerSpecCache
                     return schemaManager.getNormalizerMapping();
                 }
             });
-        
+
         initialize( directoryService );
     }
 
@@ -118,47 +118,46 @@ public class TriggerSpecCache
         // generate TriggerSpecification arrays for each subentry
         // add that subentry to the hash
         Set<String> suffixes = nexus.listSuffixes();
-        
+
         AttributeType objectClassAt = directoryService.getSchemaManager().
             getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
-        
+
         for ( String suffix:suffixes )
         {
             DN baseDn = DNFactory.create( suffix );
-            ExprNode filter = new EqualityNode<String>( objectClassAt, 
+            ExprNode filter = new EqualityNode<String>( objectClassAt,
                     new StringValue( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRY_OC ) );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            
+
             DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
-            CoreSession adminSession = new DefaultCoreSession( 
+            CoreSession adminSession = new DefaultCoreSession(
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
 
             SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, baseDn,
                 filter, ctls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
-            
+
             EntryFilteringCursor results = nexus.search( searchOperationContext );
-            
+
             try
-            { 
+            {
                 while ( results.next() )
                 {
                     ClonedServerEntry resultEntry = results.get();
                     DN subentryDn = resultEntry.getDn();
                     EntryAttribute triggerSpec = resultEntry.get( PRESCRIPTIVE_TRIGGER_ATTR );
-                    
+
                     if ( triggerSpec == null )
                     {
                         LOG.warn( "Found triggerExecutionSubentry '" + subentryDn + "' without any " + PRESCRIPTIVE_TRIGGER_ATTR );
                         continue;
                     }
-    
-                    DN normSubentryName = subentryDn.normalize( directoryService.getSchemaManager()
-                        .getNormalizerMapping() );
+
+                    DN normSubentryName = subentryDn.normalize( directoryService.getSchemaManager() );
                     subentryAdded( normSubentryName, resultEntry );
                 }
-                
+
                 results.close();
             }
             catch ( Exception e )
@@ -182,14 +181,14 @@ public class TriggerSpecCache
     {
         // only do something if the entry contains prescriptiveTrigger
         EntryAttribute triggerSpec = entry.get( PRESCRIPTIVE_TRIGGER_ATTR );
-        
+
         if ( triggerSpec == null )
         {
             return;
         }
-        
+
         List<TriggerSpecification> subentryTriggerSpecs = new ArrayList<TriggerSpecification>();
-        
+
         for ( Value<?> value:triggerSpec )
         {
             TriggerSpecification item = null;
@@ -204,9 +203,9 @@ public class TriggerSpecCache
                 String msg = I18n.err( I18n.ERR_73, item );
                 LOG.error( msg, e );
             }
-            
+
         }
-        
+
         triggerSpecs.put( normName.getNormName(), subentryTriggerSpecs );
     }
 
@@ -238,7 +237,7 @@ public class TriggerSpecCache
         {
             isTriggerSpecModified |= mod.getAttribute().contains( PRESCRIPTIVE_TRIGGER_ATTR );
         }
-        
+
         if ( isTriggerSpecModified )
         {
             subentryDeleted( normName, entry );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.schema;
 
@@ -502,7 +502,7 @@ public class SchemaCheckerTest
 
         // test success using more than one attribute for the Rdn but not modifying rdn attribute
         name = DNFactory.create( "ou=users+cn=system users,dc=example,dc=com" );
-        name.normalize( oidNormalizers );
+        name.normalize( schemaManager );
         SchemaChecker.preventRdnChangeOnModifyRemove( name, mod, new DefaultEntryAttribute( "sn", snAt,
             "does not matter" ), schemaManager );
 

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
@@ -73,7 +73,7 @@ public class JdbmPartition extends Abstr
         store.setId( id );
 
         // Normalize the suffix
-        suffix.normalize( schemaManager.getNormalizerMapping() );
+        suffix.normalize( schemaManager );
         store.setSuffixDn( suffix );
         store.setPartitionDir( getPartitionDir() );
 

Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
@@ -146,7 +146,7 @@ public class ServerEntrySerializerTest
     public void testSerializeDNServerEntry() throws Exception
     {
         DN dn = new DN( "cn=text, dc=example, dc=com" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
 
@@ -167,7 +167,7 @@ public class ServerEntrySerializerTest
     public void testSerializeServerEntryOC() throws Exception
     {
         DN dn = new DN( "cn=text, dc=example, dc=com" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "inetOrgPerson", "organizationalPerson" );
@@ -190,7 +190,7 @@ public class ServerEntrySerializerTest
     public void testSerializeServerEntry() throws Exception
     {
         DN dn = new DN( "cn=text, dc=example, dc=com" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "inetOrgPerson", "organizationalPerson" );
@@ -216,7 +216,7 @@ public class ServerEntrySerializerTest
     public void testSerializeServerEntryWithEmptyDN() throws Exception
     {
         DN dn = new DN( "" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "inetOrgPerson", "organizationalPerson" );
@@ -238,7 +238,7 @@ public class ServerEntrySerializerTest
     public void testSerializeServerEntryWithNoAttributes() throws Exception
     {
         DN dn = new DN( "" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
 
@@ -256,7 +256,7 @@ public class ServerEntrySerializerTest
     public void testSerializeServerEntryWithAttributeNoValue() throws Exception
     {
         DN dn = new DN( "" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
 
@@ -277,7 +277,7 @@ public class ServerEntrySerializerTest
     public void testSerializeServerEntryWithAttributeStringValue() throws Exception
     {
         DN dn = new DN( "" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
 
@@ -296,7 +296,7 @@ public class ServerEntrySerializerTest
     public void testSerializeServerEntryWithAttributeBinaryValue() throws Exception
     {
         DN dn = new DN( "" );
-        dn.normalize( oids );
+        dn.normalize( schemaManager );
 
         Entry entry = new DefaultEntry( schemaManager, dn );
 

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=982332&r1=982331&r2=982332&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 Aug  4 17:13:46 2010
@@ -82,10 +82,10 @@ import org.slf4j.LoggerFactory;
  *           +--> cn=another test.ldif
  *                ...
  * </pre>
- * <br><br>            
- * In this exemple, the partition's suffix is <b>ou=example,ou=system</b>. 
- * <br>   
- *  
+ * <br><br>
+ * In this exemple, the partition's suffix is <b>ou=example,ou=system</b>.
+ * <br>
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class LdifPartition extends BTreePartition<Long>
@@ -177,7 +177,7 @@ public class LdifPartition extends BTree
 
         if ( !suffix.isNormalized() )
         {
-            suffix.normalize( schemaManager.getNormalizerMapping() );
+            suffix.normalize( schemaManager );
         }
 
         String suffixDirName = getFileName( suffix );
@@ -378,7 +378,7 @@ public class LdifPartition extends BTree
         DN oldDn = renameContext.getDn();
         Long id = getEntryId( oldDn );
 
-        // Create the new entry 
+        // Create the new entry
         wrappedPartition.rename( renameContext );
 
         // Get the modified entry and store it in the context for post usage
@@ -410,11 +410,11 @@ public class LdifPartition extends BTree
         try
         {
             IndexCursor<Long, Entry, Long> cursor = getSubLevelIndex().forwardCursor( entryIdOld );
-    
+
             while ( cursor.next() )
             {
                 IndexEntry<Long, Entry, Long> entry = cursor.get();
-    
+
                 // except the parent entry add the rest of entries
                 if ( entry.getId() != entryIdOld )
                 {
@@ -447,16 +447,16 @@ public class LdifPartition extends BTree
      * loads the configuration into the DIT from the file system
      * Note that it assumes the presence of a directory with the partition suffix's upname
      * under the partition's base dir
-     * 
+     *
      * for ex. if 'config' is the partition's id and 'ou=config' is its suffix it looks for the dir with the path
-     * 
+     *
      * <directory-service-working-dir>/config/ou=config
      * e.x example.com/config/ou=config
-     * 
-     * NOTE: this dir setup is just to ease the testing of this partition, this needs to be 
+     *
+     * NOTE: this dir setup is just to ease the testing of this partition, this needs to be
      * replaced with some kind of bootstrapping the default config from a jar file and
      * write to the FS in LDIF format
-     * 
+     *
      * @throws Exception
      */
     private void loadEntries( File entryDir ) throws Exception
@@ -527,7 +527,7 @@ public class LdifPartition extends BTree
         StringBuilder filePath = new StringBuilder();
         filePath.append( suffixDirectory ).append( File.separator );
 
-        DN baseDn = ( DN ) entryDn.getSuffix( suffix.size() );
+        DN baseDn = entryDn.getSuffix( suffix.size() );
 
         for ( int i = 0; i < baseDn.size() - 1; i++ )
         {
@@ -537,9 +537,9 @@ public class LdifPartition extends BTree
         }
 
         String rdnFileName = getFileName( entryDn.getRdn() ) + CONF_FILE_EXTN;
-        
+
         String parentDir = null;
-        
+
         if( entryDn.equals( suffix ) )
         {
             parentDir = suffixDirectory.getParent() + File.separator;
@@ -570,9 +570,9 @@ public class LdifPartition extends BTree
 
 
     /**
-     * Compute the real name based on the RDN, assuming that depending on the underlying 
+     * Compute the real name based on the RDN, assuming that depending on the underlying
      * OS, some characters are not allowed.
-     * 
+     *
      * We don't allow filename which length is > 255 chars.
      */
     private String getFileName( RDN rdn ) throws LdapException
@@ -606,9 +606,9 @@ public class LdifPartition extends BTree
 
 
     /**
-     * Compute the real name based on the DN, assuming that depending on the underlying 
+     * Compute the real name based on the DN, assuming that depending on the underlying
      * OS, some characters are not allowed.
-     * 
+     *
      * We don't allow filename which length is > 255 chars.
      */
     private String getFileName( DN dn ) throws LdapException
@@ -650,7 +650,7 @@ public class LdifPartition extends BTree
     {
         if ( SystemUtils.IS_OS_WINDOWS )
         {
-            // On Windows, we escape '/', '<', '>', '\', '|', '"', ':', '+', ' ', '[', ']', 
+            // On Windows, we escape '/', '<', '>', '\', '|', '"', ':', '+', ' ', '[', ']',
             // '*', [0x00-0x1F], '?'
             StringBuilder sb = new StringBuilder();
 
@@ -765,8 +765,8 @@ public class LdifPartition extends BTree
     }
 
 
-    /** 
-     * Recursively delete an entry and all of its children. If the entry is a directory, 
+    /**
+     * Recursively delete an entry and all of its children. If the entry is a directory,
      * then get into it, call the same method on each of the contained files,
      * and delete the directory.
      */