directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r763539 - in /directory/apacheds/branches/ldif-partition/core/src: main/java/org/apache/directory/server/core/changelog/ main/java/org/apache/directory/server/core/impl/ main/java/org/apache/directory/server/core/partition/ test/java/org/ap...
Date Thu, 09 Apr 2009 07:18:55 GMT
Author: akarasulu
Date: Thu Apr  9 07:18:55 2009
New Revision: 763539

URL: http://svn.apache.org/viewvc?rev=763539&view=rev
Log:

 o adjusted for changes to init=>initialize making it take a Registries object
 o DefaultPartitionNexus now throws exception when this initialize is called 
   but it also contains an overload taking a DirectoryService. The nexus was 
   preventing us from chaning Partition.init(DirectoryService).  Once this was
   fixed we could then reduce from a dependency on DirectoryService to a 
   Registries object.

Modified:
    directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
    directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/impl/DefaultDirectoryService.java
    directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java
    directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java

Modified: directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java?rev=763539&r1=763538&r2=763539&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
(original)
+++ directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
Thu Apr  9 07:18:55 2009
@@ -306,7 +306,7 @@
                 tmp.createPartition( partitionSuffix, revContainerName, tagContainerName
);
                 
                 Partition partition = tmp.getPartition();
-                partition.init( service );
+                partition.initialize( null );
 
                 service.addPartition( partition );
             }

Modified: directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/impl/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/impl/DefaultDirectoryService.java?rev=763539&r1=763538&r2=763539&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/impl/DefaultDirectoryService.java
(original)
+++ directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/impl/DefaultDirectoryService.java
Thu Apr  9 07:18:55 2009
@@ -1353,7 +1353,8 @@
 
         schemaPartition.setIndexedAttributes( indexedAttributes );
         schemaPartition.setSuffix( ServerDNConstants.OU_SCHEMA_DN );
-        schemaPartition.init( this );
+        schemaPartition.setWorkingDirectory( new File( workingDirectory, schemaPartition.getId()
) );
+        schemaPartition.initialize( registries );
 
         // --------------------------------------------------------------------
         // Enable schemas of all indices of partition configurations 
@@ -1427,7 +1428,7 @@
         adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG
), this );
 
         partitionNexus = new DefaultPartitionNexus( new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN
) );
-        partitionNexus.init( this );
+        partitionNexus.initialize( this );
         partitionNexus.addContextPartition( new AddContextPartitionOperationContext( adminSession,
schemaPartition ) );
 
         // Create all the bootstrap entries before initializing chain

Modified: directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=763539&r1=763538&r2=763539&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/branches/ldif-partition/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Thu Apr  9 07:18:55 2009
@@ -93,6 +93,8 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.directory.SearchControls;
 import javax.naming.ldap.LdapContext;
+
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -236,8 +238,14 @@
         throw new UnsupportedOperationException( "The id cannot be set for the partition
nexus." );
     }
 
+    
+    public void initialize( Registries registries )
+    {
+        throw new UnsupportedOperationException( "For the nexus use the initialize(DirectoryService)
overload." );
+    }
+    
 
-    public void init( DirectoryService directoryService )
+    public void initialize( DirectoryService directoryService )
         throws Exception
     {
         // NOTE: We ignore ContextPartitionConfiguration parameter here.
@@ -327,11 +335,12 @@
             jdbmPartition.setId( "system" );
             jdbmPartition.setCacheSize( 500 );
             jdbmPartition.setSuffix( ServerDNConstants.SYSTEM_DN );
+            jdbmPartition.setWorkingDirectory( new File( directoryService.getWorkingDirectory(),
"system" ) );
 
             system = jdbmPartition;
         }
 
-        system.init( directoryService );
+        system.initialize( registries );
         
         // Add root context entry for system partition
         LdapDN systemSuffixDn = new LdapDN( ServerDNConstants.SYSTEM_DN );
@@ -544,7 +553,7 @@
 
         if ( ! partition.isInitialized() )
         {
-            partition.init( directoryService );
+            partition.initialize( registries );
         }
         
         synchronized ( partitionLookupTree )
@@ -718,10 +727,10 @@
         
         if ( namingContexts != null )
         {
-            namingContexts.remove( partition.getNormSuffixDn().getUpName() );
+            namingContexts.remove( partition.getUpSuffixDn().getUpName() );
         }
         
-        partitions.remove( partition.getNormSuffixDn().toString() );
+        partitions.remove( partition.getUpSuffixDn().getUpName() );
     }
 
 

Modified: directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java?rev=763539&r1=763538&r2=763539&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java
(original)
+++ directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java
Thu Apr  9 07:18:55 2009
@@ -22,8 +22,8 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.server.xdbm.XdbmPartition;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.tree.DnBranchNode;
@@ -190,7 +190,7 @@
         /**
          * @{inhertDoc}
          */
-        public void init( DirectoryService core ) throws Exception
+        public void initialize( Registries registries ) throws Exception
         {
         }
         

Modified: directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java?rev=763539&r1=763538&r2=763539&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
(original)
+++ directory/apacheds/branches/ldif-partition/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
Thu Apr  9 07:18:55 2009
@@ -134,6 +134,7 @@
         schemaPartition = new JdbmPartition();
         schemaPartition.setId( "schema" );
         schemaPartition.setCacheSize( 1000 );
+        schemaPartition.setWorkingDirectory( new File( directoryService.getWorkingDirectory(),
"schema" ) );
 
         Set<JdbmIndex<?, ServerEntry>> indexedAttributes = new HashSet<JdbmIndex<?,
ServerEntry>>();
         for ( String attributeId : extractor.getDbFileListing().getIndexedAttributes() )
@@ -143,7 +144,7 @@
 
         schemaPartition.setIndexedAttributes( indexedAttributes );
         schemaPartition.setSuffix( "ou=schema" );
-        schemaPartition.init( directoryService );
+        schemaPartition.initialize( registries );
     }
     
     



Mime
View raw message