directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1038516 [1/2] - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/test/java/org/apache/directory/server/core/ core/src/main/java/org/apache/directory/server/core/ core/src/main/java/org/apa...
Date Wed, 24 Nov 2010 08:04:08 GMT
Author: seelmann
Date: Wed Nov 24 08:04:06 2010
New Revision: 1038516

URL: http://svn.apache.org/viewvc?rev=1038516&view=rev
Log:
Fixed problem with many ehcache threads in integration tests
o Shutdown CacheManager in CacheService.destroy()
o DNFactory is now managed by DirectoryService
o Extracted DNFactory interface and removed unused methods from DNFactory


Added:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DNFactory.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDNFactory.java
      - copied, changed from r1038194, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DNFactory.java
Removed:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DNFactory.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.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/authz/GroupCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.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/prefs/PreferencesUtils.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
    directory/apacheds/trunk/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java Wed Nov 24 08:04:06 2010
@@ -85,7 +85,9 @@ public class CacheService
     public void destroy()
     {
         LOG.info( "clearing all the caches" );
+
         cacheManager.clearAll();
+        cacheManager.shutdown();
     }
 
 

Added: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DNFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DNFactory.java?rev=1038516&view=auto
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DNFactory.java (added)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DNFactory.java Wed Nov 24 08:04:06 2010
@@ -0,0 +1,54 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   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.
+ *
+ */
+package org.apache.directory.server.core;
+
+
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.name.DN;
+
+
+/**
+ * A factory for DNs, with a cache.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface DNFactory
+{
+
+    /**
+     * Creates a DN from user provided RDNs.
+     *
+     * @param upRdns the user provided RDNs
+     * @return the created DN
+     * @throws LdapInvalidDnException if one of the strings isn't a valid RDN
+     */
+    DN create( String... upRdns ) throws LdapInvalidDnException;
+
+
+    /**
+     * Creates a DN form a user provided DN.
+     *
+     * @param upDn the user provided DN
+     * @return the created DN
+     * @throws LdapInvalidDnException if the string isn't a valid DN
+     */
+    DN create( String upDn ) throws LdapInvalidDnException;
+
+}
\ No newline at end of file

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java Wed Nov 24 08:04:06 2010
@@ -579,4 +579,12 @@ public interface DirectoryService extend
      * @param policyContainer the container holding all the password policies
      */
     void setPwdPolicies( PpolicyConfigContainer policyContainer );
+
+
+    /**
+     * Gets the DN factory.
+     *
+     * @return the DN factory
+     */
+    DNFactory getDNFactory();
 }

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java Wed Nov 24 08:04:06 2010
@@ -555,4 +555,13 @@ public class MockDirectoryService implem
     public void setPwdPolicies( PpolicyConfigContainer policyContainer )
     {
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public DNFactory getDNFactory()
+    {
+        return null;
+    }
 }

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDNFactory.java (from r1038194, 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/DefaultDNFactory.java?p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDNFactory.java&p1=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DNFactory.java&r1=1038194&r2=1038516&rev=1038516&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/DefaultDNFactory.java Wed Nov 24 08:04:06 2010
@@ -32,43 +32,44 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * A DN factory.
+ * The default DN factory implementation.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DNFactory
+public class DefaultDNFactory implements DNFactory
 {
+    private static final Logger LOG = LoggerFactory.getLogger( DefaultDNFactory.class );
 
-    /** a cache for DNs */
-    // this cache instance will be initialized only when DNFactory gets initialized by
-    // directory service. Other classes(like tests) can still use this factory but no cache is maintained
-    // FIXME this decision needs to be evaluated
-    private static Cache DN_CACHE;
+    /** The cache for DNs */
+    private Cache dnCache;
 
-    private static final Logger LOG = LoggerFactory.getLogger( DNFactory.class );
+    /** The schema manager */
+    private SchemaManager schemaManager;
 
-    private static SchemaManager schemaManager;
-
-    private static boolean enableStats = false;
+    /** Flag to enable stats */
+    private boolean enableStats = false;
 
     // stat counters
-    private static int hitCount = 0;
-    private static int missCount = 0;
+    private int hitCount = 0;
+    private int missCount = 0;
 
 
     /**
-     * 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
+     * Instantiates a new default DN factory.
      *
-     * @param dn the upName of the DN
-     * @param schemaManager the schema manager (optional)
-     * @return a DN
-     * @throws LdapInvalidDnException
+     * @param directoryService the directory service
      */
-    public static DN create( String dn, SchemaManager schemaManager ) throws LdapInvalidDnException
+    public DefaultDNFactory( SchemaManager schemaManager, Cache dnCache )
+    {
+        this.schemaManager = schemaManager;
+        this.dnCache = dnCache;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public DN create( String dn ) throws LdapInvalidDnException
     {
         if ( dn == null )
         {
@@ -84,10 +85,10 @@ public class DNFactory
 
         // read the explanation at the above DN_CACHE variable declaration
         // for the reason for performing this check
-        if( DN_CACHE != null )
+        if ( dnCache != null )
         {
-            Element dnCacheEntry = DN_CACHE.get( dn );
-            
+            Element dnCacheEntry = dnCache.get( dn );
+
             if ( dnCacheEntry != null )
             {
                 cachedDN = ( DN ) dnCacheEntry.getValue();
@@ -100,9 +101,9 @@ public class DNFactory
 
             cachedDN = new DN( dn, schemaManager );
 
-            if( DN_CACHE != null )
+            if ( dnCache != null )
             {
-                DN_CACHE.put( new Element( dn, cachedDN ) );
+                dnCache.put( new Element( dn, cachedDN ) );
             }
 
             if ( enableStats )
@@ -124,25 +125,22 @@ public class DNFactory
         }
 
         LOG.debug( "DN {} found in the cache", dn );
-        
+
         if ( enableStats )
         {
             //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() );
         }
-        
-        return cachedDN;
-    }
-
 
-    public static DN create( String... upRdns ) throws LdapInvalidDnException
-    {
-        return create( schemaManager, upRdns );
+        return cachedDN;
     }
 
 
-    public static DN create( SchemaManager schemaManager, String... upRdns ) throws LdapInvalidDnException
+    /**
+     * {@inheritDoc}
+     */
+    public DN create( String... upRdns ) throws LdapInvalidDnException
     {
         StringBuilder sb = new StringBuilder();
         for ( String s : upRdns )
@@ -152,53 +150,7 @@ public class DNFactory
 
         String dn = sb.toString();
         dn = dn.substring( 0, dn.length() - 1 );
-        return create( dn, schemaManager );
+        return create( dn );
     }
 
-
-    public static DN create( DN dn ) throws LdapInvalidDnException
-    {
-        return create( dn.getName(), schemaManager );
-    }
-
-
-    public static DN create( DN dn, SchemaManager schemaManager ) throws LdapInvalidDnException
-    {
-        return create( dn.getName(), schemaManager );
-    }
-
-
-    public static DN create( String dn ) throws LdapInvalidDnException
-    {
-        return create( dn, schemaManager );
-    }
-
-
-    public static void setSchemaManager( SchemaManager schemaManager )
-    {
-        DNFactory.schemaManager = schemaManager;
-    }
-
-    
-    /**
-     * this method will be called from the DefaultDirectoryService during startup
-     */
-    protected static void initialize( DirectoryService dirService )
-    {
-        schemaManager = dirService.getSchemaManager();
-        DN_CACHE = dirService.getCacheService().getCache( "dnCache" );
-    }
-    
-    
-    /**
-     * clears all the DNs present in the cache 
-     */
-    public static void clearCache()
-    {
-        if( DN_CACHE != null )
-        {
-            LOG.debug( "clearing all the DNs from cache" );
-            DN_CACHE.removeAll();
-        }
-    }
 }

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -263,10 +263,13 @@ public class DefaultDirectoryService imp
 
     /** a container to hold all the ppolicies */
     private PpolicyConfigContainer pwdPolicyContainer;
-    
+
     /** the pwdPolicySubentry AT */
     private AttributeType pwdPolicySubentryAT;
-    
+
+    /** The DN factory */
+    private DNFactory dnFactory;
+
     /**
      * The synchronizer thread. It flush data on disk periodically.
      */
@@ -1207,7 +1210,7 @@ public class DefaultDirectoryService imp
         // create system users area
         // -------------------------------------------------------------------
 
-        DN userDn = DNFactory.create( ServerDNConstants.USERS_SYSTEM_DN, schemaManager );
+        DN userDn = getDNFactory().create( ServerDNConstants.USERS_SYSTEM_DN );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, userDn ) ) )
         {
@@ -1232,7 +1235,7 @@ public class DefaultDirectoryService imp
         // create system groups area
         // -------------------------------------------------------------------
 
-        DN groupDn = DNFactory.create( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
+        DN groupDn = getDNFactory().create( ServerDNConstants.GROUPS_SYSTEM_DN );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, groupDn ) ) )
         {
@@ -1257,7 +1260,7 @@ public class DefaultDirectoryService imp
         // create administrator group
         // -------------------------------------------------------------------
 
-        DN name = DNFactory.create( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
+        DN name = getDNFactory().create( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, name ) ) )
         {
@@ -1283,7 +1286,7 @@ public class DefaultDirectoryService imp
         // create system configuration area
         // -------------------------------------------------------------------
 
-        DN configurationDn = DNFactory.create( "ou=configuration,ou=system", schemaManager );
+        DN configurationDn = getDNFactory().create( "ou=configuration,ou=system" );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, configurationDn ) ) )
         {
@@ -1305,7 +1308,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for partition information
         // -------------------------------------------------------------------
 
-        DN partitionsDn = DNFactory.create( "ou=partitions,ou=configuration,ou=system", schemaManager );
+        DN partitionsDn = getDNFactory().create( "ou=partitions,ou=configuration,ou=system" );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, partitionsDn ) ) )
         {
@@ -1326,7 +1329,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for services
         // -------------------------------------------------------------------
 
-        DN servicesDn = DNFactory.create( "ou=services,ou=configuration,ou=system", schemaManager );
+        DN servicesDn = getDNFactory().create( "ou=services,ou=configuration,ou=system" );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, servicesDn ) ) )
         {
@@ -1348,7 +1351,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for interceptors
         // -------------------------------------------------------------------
 
-        DN interceptorsDn = DNFactory.create( "ou=interceptors,ou=configuration,ou=system", schemaManager );
+        DN interceptorsDn = getDNFactory().create( "ou=interceptors,ou=configuration,ou=system" );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, interceptorsDn ) ) )
         {
@@ -1370,7 +1373,7 @@ public class DefaultDirectoryService imp
         // create system preferences area
         // -------------------------------------------------------------------
 
-        DN sysPrefRootDn = DNFactory.create( ServerDNConstants.SYSPREFROOT_SYSTEM_DN, schemaManager );
+        DN sysPrefRootDn = getDNFactory().create( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
 
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, sysPrefRootDn ) ) )
         {
@@ -1404,7 +1407,7 @@ public class DefaultDirectoryService imp
         // Warn if the default password is not changed.
         boolean needToChangeAdminPassword = false;
 
-        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        DN adminDn = getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
 
         Entry adminEntry = partitionNexus.lookup( new LookupOperationContext( adminSession, adminDn ) );
         Value<?> userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
@@ -1473,7 +1476,7 @@ public class DefaultDirectoryService imp
         subschemaAPCache = new DnNode<SubschemaAdministrativePoint>();
         triggerExecutionAPCache = new DnNode<TriggerExecutionAdministrativePoint>();
 
-        DNFactory.initialize( this );
+        dnFactory = new DefaultDNFactory( schemaManager, cacheService.getCache( "dnCache" ) );
 
         // triggers partition to load schema fully from schema partition
         schemaService.initialize();
@@ -1483,7 +1486,7 @@ public class DefaultDirectoryService imp
 
         pwdPolicySubentryAT = schemaManager.lookupAttributeTypeRegistry( "pwdPolicySubentry" );
         
-        adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        adminDn = getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), this );
 
         // @TODO - NOTE: Need to find a way to instantiate without dependency on DPN
@@ -1610,7 +1613,7 @@ public class DefaultDirectoryService imp
         try
         {
             Entry entry = readEntry( ldif );
-            DN newDn = DNFactory.create( dn );
+            DN newDn = getDNFactory().create( dn );
 
             entry.setDn( newDn );
 
@@ -1888,7 +1891,7 @@ public class DefaultDirectoryService imp
             
             if ( pwdPolicySubentry != null )
             {
-                DN configDn = DNFactory.create( pwdPolicySubentry.getString(), schemaManager );
+                DN configDn = getDNFactory().create( pwdPolicySubentry.getString() );
                 
                 return pwdPolicyContainer.getPolicyConfig( configDn );
             }
@@ -1917,4 +1920,13 @@ public class DefaultDirectoryService imp
         this.pwdPolicyContainer = policyContainer;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
+    public DNFactory getDNFactory()
+    {
+        return dnFactory;
+    }
+
 }
\ No newline at end of file

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java Wed Nov 24 08:04:06 2010
@@ -161,7 +161,7 @@ public class ReferralManagerImpl impleme
         for ( String suffix:suffixes )
         {
             // We will store each entry's DN into the Referral tree
-            DN suffixDn = DNFactory.create( suffix, directoryService.getSchemaManager() );
+            DN suffixDn = directoryService.getDNFactory().create( suffix );
 
             SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffixDn, referralFilter, searchControl );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -32,7 +32,6 @@ import javax.naming.directory.SearchCont
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -191,7 +190,7 @@ public class AciAuthorizationInterceptor
     {
         super.init( directoryService );
 
-        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
+        DN adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
         schemaManager = directoryService.getSchemaManager();
@@ -214,7 +213,7 @@ public class AciAuthorizationInterceptor
         // stuff for dealing with subentries (garbage for now)
         Value<?> subschemaSubentry = directoryService.getPartitionNexus().getRootDSE( null ).get(
             SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        DN subschemaSubentryDnName = DNFactory.create( subschemaSubentry.getString(), schemaManager );
+        DN subschemaSubentryDnName = directoryService.getDNFactory().create( subschemaSubentry.getString() );
         subschemaSubentryDn = subschemaSubentryDnName.getNormName();
     }
 

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -27,7 +27,6 @@ import javax.naming.NoPermissionExceptio
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -108,11 +107,11 @@ public class DefaultAuthorizationInterce
         nexus = directoryService.getPartitionNexus();
         SchemaManager schemaManager = directoryService.getSchemaManager();
 
-        ADMIN_SYSTEM_DN = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        ADMIN_SYSTEM_DN = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
 
-        GROUP_BASE_DN = DNFactory.create( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
+        GROUP_BASE_DN = directoryService.getDNFactory().create( ServerDNConstants.GROUPS_SYSTEM_DN );
 
-        ADMIN_GROUP_DN = DNFactory.create( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
+        ADMIN_GROUP_DN = directoryService.getDNFactory().create( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
 
         uniqueMemberAT = schemaManager.getAttributeType( SchemaConstants.UNIQUE_MEMBER_AT_OID );
 
@@ -124,7 +123,7 @@ public class DefaultAuthorizationInterce
     {
         // read in the administrators and cache their normalized names
         Set<String> newAdministrators = new HashSet<String>( 2 );
-        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
+        DN adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
 
@@ -139,7 +138,7 @@ public class DefaultAuthorizationInterce
 
         for ( Value<?> value : uniqueMember )
         {
-            DN memberDn = DNFactory.create( value.getString(), directoryService.getSchemaManager() );
+            DN memberDn = directoryService.getDNFactory().create( value.getString() );
             newAdministrators.add( memberDn.getNormName() );
         }
 

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -86,6 +86,9 @@ public class GroupCache
      * the schema manager
      */
     private SchemaManager schemaManager;
+    
+    /** the DN factory */
+    private DNFactory dnFactory;
 
     /** the normalized dn of the administrators group */
     private DN administratorsGroupDn;
@@ -104,6 +107,7 @@ public class GroupCache
     public GroupCache( DirectoryService dirService ) throws LdapException
     {
         schemaManager = dirService.getSchemaManager();
+        dnFactory = dirService.getDNFactory();
         nexus = dirService.getPartitionNexus();
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
         MEMBER_AT = schemaManager.getAttributeType( SchemaConstants.MEMBER_AT );
@@ -120,7 +124,7 @@ public class GroupCache
 
     private DN parseNormalized( String name ) throws LdapException
     {
-        DN dn = DNFactory.create( name, schemaManager );
+        DN dn = dnFactory.create( name );
         return dn;
     }
 
@@ -143,7 +147,7 @@ public class GroupCache
             filter.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
                 SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC ) ) );
 
-            DN baseDn = DNFactory.create( suffix, schemaManager );
+            DN baseDn = dnFactory.create( suffix );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -76,6 +76,9 @@ public class TupleCache
     /** a map of strings to ACITuple collections */
     private final Map<String, List<ACITuple>> tuples = new HashMap<String, List<ACITuple>>();
 
+    /** the DN factory */
+    private final DNFactory dnFactory;
+
     /** a handle on the partition nexus */
     private final PartitionNexus nexus;
 
@@ -98,6 +101,7 @@ public class TupleCache
     public TupleCache( CoreSession session ) throws LdapException
     {
         SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
+        this.dnFactory = session.getDirectoryService().getDNFactory();
         this.nexus = session.getDirectoryService().getPartitionNexus();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( schemaManager );
         aciParser = new ACIItemParser( ncn, schemaManager );
@@ -107,9 +111,9 @@ public class TupleCache
     }
 
 
-    private DN parseNormalized( SchemaManager schemaManager, String name ) throws LdapException
+    private DN parseNormalized( String name ) throws LdapException
     {
-        DN dn = DNFactory.create( name, schemaManager );
+        DN dn = dnFactory.create( name );
         return dn;
     }
 
@@ -123,7 +127,7 @@ public class TupleCache
 
         for ( String suffix:suffixes )
         {
-            DN baseDn = parseNormalized( session.getDirectoryService().getSchemaManager(), suffix );
+            DN baseDn = parseNormalized( suffix );
             ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT,
                 new StringValue( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) );
             SearchControls ctls = new SearchControls();

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Wed Nov 24 08:04:06 2010
@@ -24,7 +24,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
@@ -417,7 +416,7 @@ public class CollectiveAttributeIntercep
         for ( Value<?> value : collectiveAttributeSubentries )
         {
             String subentryDnStr = value.getString();
-            DN subentryDn = DNFactory.create( subentryDnStr );
+            DN subentryDn = opContext.getSession().getDirectoryService().getDNFactory().create( subentryDnStr );
 
             /*
              * TODO - Instead of hitting disk here can't we leverage the 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Wed Nov 24 08:04:06 2010
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
 
 
 import org.apache.commons.collections.map.LRUMap;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
@@ -115,7 +114,7 @@ public class ExceptionInterceptor extend
     {
         nexus = directoryService.getPartitionNexus();
         Value<?> attr = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemSubentryDn = DNFactory.create( attr.getString(), directoryService.getSchemaManager() );
+        subschemSubentryDn = directoryService.getDNFactory().create( attr.getString() );
         schemaManager = directoryService.getSchemaManager();
 
         // look up some constant information

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Wed Nov 24 08:04:06 2010
@@ -28,7 +28,6 @@ import java.util.UUID;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
@@ -138,10 +137,10 @@ public class OperationalAttributeInterce
         // stuff for dealing with subentries (garbage for now)
         Value<?> subschemaSubentry = service.getPartitionNexus().getRootDSE( null ).get(
             SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemaSubentryDn = DNFactory.create( subschemaSubentry.getString(), schemaManager );
+        subschemaSubentryDn = service.getDNFactory().create( subschemaSubentry.getString() );
 
         // Create the Admin DN 
-        adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        adminDn = service.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
 
         MODIFIERS_NAME_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFIERS_NAME_AT );
         MODIFY_TIMESTAMP_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT );
@@ -514,7 +513,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN creatorsName = DNFactory.create( attr.getString() );
+                DN creatorsName = service.getDNFactory().create( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( creatorsName ).getName() );
@@ -524,7 +523,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN modifiersName = DNFactory.create( attr.getString() );
+                DN modifiersName = service.getDNFactory().create( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getName() );
@@ -534,7 +533,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN modifiersName = DNFactory.create( attr.getString() );
+                DN modifiersName = service.getDNFactory().create( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getName() );

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -37,7 +37,6 @@ import javax.naming.directory.SearchCont
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
@@ -219,7 +218,7 @@ public class DefaultPartitionNexus exten
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
 
         // Initialize and normalize the localy used DNs
-        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN );
+        DN adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminDn.normalize( schemaManager );
 
         initializeSystemPartition( directoryService );
@@ -295,7 +294,7 @@ public class DefaultPartitionNexus exten
         system.initialize();
 
         // Add root context entry for system partition
-        DN systemSuffixDn = DNFactory.create( ServerDNConstants.SYSTEM_DN, schemaManager );
+        DN systemSuffixDn = directoryService.getDNFactory().create( ServerDNConstants.SYSTEM_DN );
         CoreSession adminSession = directoryService.getAdminSession();
 
         if ( !system.hasEntry( new EntryOperationContext( adminSession, systemSuffixDn ) ) )
@@ -363,7 +362,7 @@ public class DefaultPartitionNexus exten
         {
             try
             {
-                removeContextPartition(  DNFactory.create( suffix ) );
+                removeContextPartition(  directoryService.getDNFactory().create( suffix ) );
             }
             catch ( Exception e )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java Wed Nov 24 08:04:06 2010
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
 
  
 import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
 
@@ -43,7 +42,7 @@ class PreferencesUtils
      */
     public static DN toSysDn( String absPrefPath ) throws LdapInvalidDnException
     {
-        DN dn = DNFactory.create( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
+        DN dn = new DN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
 
         String[] comps = absPrefPath.split( "/" );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java Wed Nov 24 08:04:06 2010
@@ -29,18 +29,17 @@ import java.util.prefs.BackingStoreExcep
 import java.util.prefs.Preferences;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.DefaultModification;
+import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
@@ -86,7 +85,7 @@ public class ServerSystemPreferences ext
         
         try
         {
-            dn = DNFactory.create( "prefNodeName=sysPrefRoot,ou=system" );
+            dn = directoryService.getDNFactory().create( "prefNodeName=sysPrefRoot,ou=system" );
         }
         catch ( LdapInvalidDnException e )
         {
@@ -116,7 +115,7 @@ public class ServerSystemPreferences ext
         DN parentDn = ( ( ServerSystemPreferences ) parent() ).dn;
         try
         {
-            dn = DNFactory.create( "prefNodeName=" + name + "," + parentDn.getName(), directoryService.getSchemaManager() );
+            dn = directoryService.getDNFactory().create( "prefNodeName=" + name + "," + parentDn.getName() );
             
             if ( ! directoryService.getAdminSession().exists( dn ) )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Wed Nov 24 08:04:06 2010
@@ -22,7 +22,6 @@ package org.apache.directory.server.core
 
 import javax.naming.Context;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.ReferralManager;
 import org.apache.directory.server.core.ReferralManagerImpl;
@@ -212,7 +211,7 @@ public class ReferralInterceptor extends
         directoryService.setReferralManager( referralManager );
 
         Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemaSubentryDn = DNFactory.create( subschemaSubentry.getString(), schemaManager );
+        subschemaSubentryDn = directoryService.getDNFactory().create( subschemaSubentry.getString() );
 
         // look up some constant information
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Wed Nov 24 08:04:06 2010
@@ -24,7 +24,6 @@ import java.util.Set;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
@@ -79,7 +78,7 @@ public class DefaultSchemaService implem
     
     
 
-    /** 
+    /**
      * {@inheritDoc}
      */
     public boolean isSchemaSubentry( DN dn ) throws LdapException
@@ -369,7 +368,7 @@ public class DefaultSchemaService implem
     {
         try
         {
-            schemaModificationAttributesDN = DNFactory.create( ServerDNConstants.SCHEMA_MODIFICATIONS_DN, getSchemaManager() );
+            schemaModificationAttributesDN = new DN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN, getSchemaManager() );
         }
         catch ( LdapException e )
         {

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -33,7 +33,6 @@ import java.util.concurrent.ConcurrentHa
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
@@ -193,23 +192,23 @@ public class SchemaInterceptor extends B
         filters.add( binaryAttributeFilter );
         filters.add( topFilter );
 
-        schemaBaseDN = DNFactory.create( SchemaConstants.OU_SCHEMA, schemaManager );
+        schemaBaseDN = directoryService.getDNFactory().create( SchemaConstants.OU_SCHEMA );
         schemaService = directoryService.getSchemaService();
 
         // 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 = directoryService.getDNFactory().create( subschemaSubentry.getString() );
         subschemaSubentryDn.normalize( schemaManager );
         subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
 
-        schemaModificationAttributesDN = DNFactory.create( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
+        schemaModificationAttributesDN = directoryService.getDNFactory().create( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
         schemaModificationAttributesDN.normalize( schemaManager );
 
         computeSuperiors();
 
         // Initialize the schema manager
         SchemaLoader loader = schemaService.getSchemaPartition().getSchemaManager().getLoader();
-        schemaSubEntryManager = new SchemaSubentryManager( schemaManager, loader );
+        schemaSubEntryManager = new SchemaSubentryManager( schemaManager, loader, directoryService.getDNFactory() );
 
         MODIFIERS_NAME_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFIERS_NAME_AT );
         MODIFY_TIMESTAMP_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java Wed Nov 24 08:04:06 2010
@@ -22,23 +22,18 @@ package org.apache.directory.server.core
 
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import javax.naming.directory.DirContext;
-
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.DITContentRule;
 import org.apache.directory.shared.ldap.schema.DITStructureRule;
@@ -114,11 +109,11 @@ public class SchemaSubentryManager
     }
 
 
-    public SchemaSubentryManager( SchemaManager schemaManager, SchemaLoader loader )
+    public SchemaSubentryManager( SchemaManager schemaManager, SchemaLoader loader, DNFactory dnFactory )
         throws LdapException
     {
         this.schemaManager = schemaManager;
-        this.subentryModifier = new SchemaSubentryModifier( schemaManager );
+        this.subentryModifier = new SchemaSubentryModifier( schemaManager, dnFactory );
         this.parsers = new DescriptionParsers( schemaManager );
         
         String comparatorsOid = schemaManager.getAttributeTypeRegistry().getOidByName( SchemaConstants.COMPARATORS_AT );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Wed Nov 24 08:04:06 2010
@@ -77,20 +77,25 @@ public class SchemaSubentryModifier
     }
     
     private AttributesFactory factory = new AttributesFactory();
-    
+
     /** The server schemaManager */
-    private SchemaManager schemaManager; 
+    private SchemaManager schemaManager;
+
+    /** The DN factory */
+    private DNFactory dnFactory;
+
 
-    
     /**
      * 
      * Creates a new instance of SchemaSubentryModifier.
      *
      * @param schemaManager The server schemaManager
+     * @param dnFactory The DN factory
      */
-    public SchemaSubentryModifier( SchemaManager schemaManager )
+    public SchemaSubentryModifier( SchemaManager schemaManager, DNFactory dnFactory )
     {
         this.schemaManager = schemaManager;
+        this.dnFactory = dnFactory;
     }
     
     
@@ -133,14 +138,14 @@ public class SchemaSubentryModifier
         }
 
         buf.append( ",cn=" ).append( obj.getSchemaName() ).append( ",ou=schema" );
-        return DNFactory.create( buf.toString() );
+        return dnFactory.create( buf.toString() );
     }
     
 
     public void add( OperationContext opContext, LdapComparatorDescription comparatorDescription ) throws LdapException
     {
         String schemaName = getSchema( comparatorDescription );   
-        DN dn = DNFactory.create( 
+        DN dn = dnFactory.create( 
             "m-oid=" + comparatorDescription.getOid(),
             SchemaConstants.COMPARATORS_PATH,
             "cn=" + schemaName,
@@ -155,7 +160,7 @@ public class SchemaSubentryModifier
     public void add( OperationContext opContext, NormalizerDescription normalizerDescription ) throws LdapException
     {
         String schemaName = getSchema( normalizerDescription );
-        DN dn = DNFactory.create( 
+        DN dn = dnFactory.create( 
             "m-oid=" + normalizerDescription.getOid(),
             SchemaConstants.NORMALIZERS_PATH , 
             "cn=" + schemaName,
@@ -170,7 +175,7 @@ public class SchemaSubentryModifier
     public void add( OperationContext opContext, SyntaxCheckerDescription syntaxCheckerDescription ) throws LdapException
     {
         String schemaName = getSchema( syntaxCheckerDescription );
-        DN dn = DNFactory.create( 
+        DN dn = dnFactory.create( 
             "m-oid=" + syntaxCheckerDescription.getOid(),
             SchemaConstants.SYNTAX_CHECKERS_PATH,
             "cn=" + schemaName, 
@@ -202,7 +207,7 @@ public class SchemaSubentryModifier
     public void delete( OperationContext opContext, NormalizerDescription normalizerDescription ) throws LdapException
     {
         String schemaName = getSchema( normalizerDescription );
-        DN dn = DNFactory.create( 
+        DN dn = dnFactory.create( 
             "m-oid=" + normalizerDescription.getOid(),
             SchemaConstants.NORMALIZERS_PATH,
             "cn=" + schemaName, 
@@ -215,7 +220,7 @@ public class SchemaSubentryModifier
     public void delete( OperationContext opContext, SyntaxCheckerDescription syntaxCheckerDescription ) throws LdapException
     {
         String schemaName = getSchema( syntaxCheckerDescription );
-        DN dn = DNFactory.create( 
+        DN dn = dnFactory.create( 
             "m-oid=" + syntaxCheckerDescription.getOid(), 
             SchemaConstants.SYNTAX_CHECKERS_PATH,
             "cn=" + schemaName,
@@ -227,7 +232,7 @@ public class SchemaSubentryModifier
     public void delete( OperationContext opContext, LdapComparatorDescription comparatorDescription ) throws LdapException
     {
         String schemaName = getSchema( comparatorDescription );
-        DN dn = DNFactory.create( 
+        DN dn = dnFactory.create( 
             "m-oid=" + comparatorDescription.getOid(),
             SchemaConstants.COMPARATORS_PATH,
             "cn=" + schemaName,

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java Wed Nov 24 08:04:06 2010
@@ -39,7 +39,6 @@ import org.apache.commons.lang.ArrayUtil
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.i18n.I18n;
@@ -79,7 +78,7 @@ public class CoreKeyStoreSpi extends Key
 
     private Entry getTlsEntry() throws Exception
     {
-        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
+        DN adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
         LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.SIMPLE );
         CoreSession session = directoryService.getSession( principal );
         return session.lookup( adminDn );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java Wed Nov 24 08:04:06 2010
@@ -25,7 +25,6 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.i18n.I18n;
@@ -75,7 +74,7 @@ public class LdapClassLoader extends Cla
     {
         super( LdapClassLoader.class.getClassLoader() );
         this.directoryService = directoryService;
-        defaultSearchDn = DNFactory.create( DEFAULT_SEARCH_CONTEXTS_CONFIG, directoryService.getSchemaManager() );
+        defaultSearchDn = directoryService.getDNFactory().create( DEFAULT_SEARCH_CONTEXTS_CONFIG );
         
         OBJECT_CLASS_AT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
     }
@@ -163,7 +162,7 @@ public class LdapClassLoader extends Cla
                 
                 for ( Value<?> val : attr )
                 {
-                    DN dn = DNFactory.create( val.getString(), directoryService.getSchemaManager() );
+                    DN dn = directoryService.getDNFactory().create( val.getString() );
                     searchContexts.add( dn );
                 }
                 
@@ -187,7 +186,7 @@ public class LdapClassLoader extends Cla
 
                 for ( String suffix:suffixes )
                 {
-                    DN dn = DNFactory.create( suffix, directoryService.getSchemaManager() );
+                    DN dn = directoryService.getDNFactory().create( suffix );
                     namingContexts.add( dn );
                 }
                 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java Wed Nov 24 08:04:06 2010
@@ -27,7 +27,6 @@ import java.util.Set;
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.i18n.I18n;
@@ -90,7 +89,7 @@ public class StoredProcExecutionManager
         AttributeType storeProcUnitNamAT = session.getDirectoryService()
             .getSchemaManager().lookupAttributeTypeRegistry( "storedProcUnitName" );
         ExprNode filter = new EqualityNode<String>( storeProcUnitNamAT, new StringValue( storeProcUnitNamAT, spUnitName ) );
-        DN dn = DNFactory.create( storedProcContainer );
+        DN dn = session.getDirectoryService().getDNFactory().create( storedProcContainer );
         EntryFilteringCursor results = session.search( dn, SearchScope.SUBTREE, filter, 
             AliasDerefMode.DEREF_ALWAYS, EMPTY_ATTRIBS );
         if ( results.first() )

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -30,7 +30,6 @@ import javax.naming.directory.SearchCont
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -235,12 +234,12 @@ public class SubentryInterceptor extends
         controls.setReturningAttributes( new String[]
             { SchemaConstants.SUBTREE_SPECIFICATION_AT, SchemaConstants.OBJECT_CLASS_AT } );
 
-        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        DN adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
 
         // search each namingContext for subentries
         for ( String suffix : suffixes )
         {
-            DN suffixDn = DNFactory.create( suffix, schemaManager );
+            DN suffixDn = directoryService.getDNFactory().create( suffix );
 
             CoreSession adminSession = new DefaultCoreSession(
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java Wed Nov 24 08:04:06 2010
@@ -27,7 +27,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.shared.ldap.exception.LdapException;
@@ -55,7 +54,7 @@ public abstract class AbstractStoredProc
     protected DN getOperationPrincipal() throws LdapInvalidDnException
     {
         Principal principal = opContext.getSession().getEffectivePrincipal();
-        DN userName = DNFactory.create( principal.getName() );
+        DN userName = opContext.getSession().getDirectoryService().getDNFactory().create( principal.getName() );
         return userName;
     }
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java Wed Nov 24 08:04:06 2010
@@ -22,7 +22,6 @@ package org.apache.directory.server.core
 
 import java.util.Map;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
@@ -54,7 +53,7 @@ public class AddStoredProcedureParameter
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( addedEntryName.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( addedEntryName.getName() );
         }
     };
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java Wed Nov 24 08:04:06 2010
@@ -22,7 +22,6 @@ package org.apache.directory.server.core
 
 import java.util.Map;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -53,7 +52,7 @@ public class DeleteStoredProcedureParame
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( deletedEntryName.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( deletedEntryName.getName() );
         }
     };
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Wed Nov 24 08:04:06 2010
@@ -22,7 +22,6 @@ package org.apache.directory.server.core
 
 import java.util.Map;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -71,7 +70,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( oldDN.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( oldDN.getName() );
         }
     };
 
@@ -83,7 +82,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( newRDN.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( newRDN.getName() );
         }
     };
 
@@ -107,7 +106,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( newSuperiorDN.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( newSuperiorDN.getName() );
         }
     };
     
@@ -119,7 +118,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( oldRDN.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( oldRDN.getName() );
         }
     };
     
@@ -131,7 +130,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( oldSuperiorDN.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( oldSuperiorDN.getName() );
         }
     };
     
@@ -143,7 +142,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( newDN.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( newDN.getName() );
         }
     };
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java Wed Nov 24 08:04:06 2010
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
@@ -62,7 +61,7 @@ public class ModifyStoredProcedureParame
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return DNFactory.create( modifiedEntryName.getName() );
+            return opContext.getSession().getDirectoryService().getDNFactory().create( modifiedEntryName.getName() );
         }
     };
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java Wed Nov 24 08:04:06 2010
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
@@ -36,7 +35,7 @@ public class SimpleTriggerExecutionAutho
     {
         try
         {
-            adminName = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            adminName = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
         }
         catch ( LdapInvalidDnException e )
         {

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -33,7 +33,6 @@ import javax.naming.directory.SearchCont
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -124,13 +123,13 @@ public class TriggerSpecCache
 
         for ( String suffix:suffixes )
         {
-            DN baseDn = DNFactory.create( suffix );
+            DN baseDn = directoryService.getDNFactory().create( suffix );
             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() );
+            DN adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             CoreSession adminSession = new DefaultCoreSession(
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
 

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=1038516&r1=1038515&r2=1038516&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 Nov 24 08:04:06 2010
@@ -31,7 +31,6 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.MockOperation;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -93,7 +92,7 @@ public class MaxImmSubFilterTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        ENTRY_NAME = DNFactory.create( "ou=test, ou=system" );
+        ENTRY_NAME = new DN( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new MaxImmSubItem( 2 ) );
         ENTRY = new DefaultEntry( schemaManager, ENTRY_NAME );
     }

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java Wed Nov 24 08:04:06 2010
@@ -31,7 +31,6 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -91,7 +90,7 @@ public class MaxValueCountFilterTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        DN entryName = DNFactory.create( "ou=test, ou=system" );
+        DN entryName = new DN( "ou=test, ou=system" );
         ENTRY = new DefaultEntry( schemaManager, entryName );
         FULL_ENTRY = new DefaultEntry( schemaManager, entryName );
         

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Wed Nov 24 08:04:06 2010
@@ -31,7 +31,6 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.event.ExpressionEvaluator;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
@@ -112,8 +111,8 @@ public class RelatedProtectedItemFilterT
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        GROUP_NAME = DNFactory.create( "ou=test,ou=groups,ou=system" );
-        USER_NAME = DNFactory.create( "ou=test, ou=users, ou=system" );
+        GROUP_NAME = new DN( "ou=test,ou=groups,ou=system" );
+        USER_NAME = new DN( "ou=test, ou=users, ou=system" );
         
         filterA = new RelatedProtectedItemFilter( new RefinementEvaluator( new RefinementLeafEvaluator(
             schemaManager ) ), new ExpressionEvaluator( schemaManager ), schemaManager );



Mime
View raw message