directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r491471 [2/5] - in /directory/trunks: ./ apacheds/ apacheds/bootstrap-partition/ apacheds/bootstrap-partition/src/ apacheds/bootstrap-partition/src/main/ apacheds/bootstrap-partition/src/main/java/ apacheds/bootstrap-partition/src/main/java...
Date Sun, 31 Dec 2006 19:46:55 GMT
Modified: directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/ObjectClasses.template
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/ObjectClasses.template?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/ObjectClasses.template (original)
+++ directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/ObjectClasses.template Sun Dec 31 11:46:40 2006
@@ -23,9 +23,10 @@
 import java.util.ArrayList;
 import javax.naming.NamingException;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+import org.apache.directory.server.schema.registries.*;
 
-#if ( $package != "org.apache.directory.server.core.schema.bootstrap" )
-import org.apache.directory.server.core.schema.bootstrap.*;
+#if ( $package != "org.apache.directory.server.schema.bootstrap" )
+import org.apache.directory.server.schema.bootstrap.*;
 #end
 
 /**
@@ -52,12 +53,12 @@
 
 
     /**
-     * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+     * @see BootstrapProducer#produce(Registries, ProducerCallback)
      */
-    public void produce( BootstrapRegistries registries, ProducerCallback cb )
+    public void produce( Registries registries, ProducerCallback cb )
         throws NamingException
     {
-        ArrayList array = new ArrayList();
+        ArrayList<String> array = new ArrayList<String>();
         BootstrapObjectClass objectClass;
 
         #foreach ( $objectClass in $objectClasses )

Modified: directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/Schema.template
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/Schema.template?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/Schema.template (original)
+++ directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/Schema.template Sun Dec 31 11:46:40 2006
@@ -22,9 +22,8 @@
 
 import java.util.ArrayList;
 
-
-#if ( $package != "org.apache.directory.server.core.schema.bootstrap" )
-import org.apache.directory.server.core.schema.bootstrap.*;
+#if ( $package != "org.apache.directory.server.schema.bootstrap" )
+import org.apache.directory.server.schema.bootstrap.*;
 #end
 
 
@@ -41,7 +40,7 @@
     {
         super( "$owner", "$schema", "$package" );
 
-        ArrayList list = new ArrayList();
+        ArrayList<String> list = new ArrayList<String>();
         #if ( $deps )
 list.clear();
        #foreach ( $name in $deps ) list.add( "$name" );

Modified: directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/typeless.template
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/typeless.template?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/typeless.template (original)
+++ directory/trunks/apacheds/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/typeless.template Sun Dec 31 11:46:40 2006
@@ -21,9 +21,10 @@
 
 
 import javax.naming.NamingException;
+import org.apache.directory.server.schema.registries.*;
 
-#if ( $package != "org.apache.directory.server.core.schema.bootstrap" )
-import org.apache.directory.server.core.schema.bootstrap.*;
+#if ( $package != "org.apache.directory.server.schema.bootstrap" )
+import org.apache.directory.server.schema.bootstrap.*;
 #end
 
 
@@ -50,9 +51,9 @@
 
 
     /**
-     * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+     * @see BootstrapProducer#produce(Registries, ProducerCallback)
      */
-    public void produce( BootstrapRegistries registries, ProducerCallback cb )
+    public void produce( Registries registries, ProducerCallback cb )
         throws NamingException
     {
     }

Modified: directory/trunks/apacheds/core-unit/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/pom.xml?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/pom.xml (original)
+++ directory/trunks/apacheds/core-unit/pom.xml Sun Dec 31 11:46:40 2006
@@ -32,6 +32,13 @@
       <artifactId>apacheds-core</artifactId>
       <version>${pom.version}</version>
     </dependency>  
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-extras</artifactId>
+      <version>${pom.version}</version>
+      <scope>test</scope>
+    </dependency>  
   </dependencies>
 
   <profiles>

Modified: directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java (original)
+++ directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java Sun Dec 31 11:46:40 2006
@@ -152,10 +152,10 @@
             partConfig.setContextEntry( attributes );
             
             configuration.setShutdownHookEnabled( false );
-            configuration.setContextPartitionConfigurations( Collections.singleton( partConfig ) );
+            configuration.setPartitionConfigurations( Collections.singleton( partConfig ) );
             
             doDelete( configuration.getWorkingDirectory() );
-            setSysRoot( username, password, configuration );
+            setContextRoots( username, password, configuration );
             
             Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
             env.put( Context.SECURITY_PRINCIPAL, username );

Modified: directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java (original)
+++ directory/trunks/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java Sun Dec 31 11:46:40 2006
@@ -80,6 +80,9 @@
     /** the context root for the system partition */
     protected LdapContext sysRoot;
 
+    /** the context root for the schema partition */
+    protected LdapContext schemaRoot;
+
     /** flag whether to delete database files for each test or not */
     protected boolean doDelete = true;
 
@@ -153,7 +156,7 @@
         
     	List entries = reader.parseLdif( LDIF );
         
-        Entry entry = (Entry)entries.get(0);
+        Entry entry = ( Entry ) entries.get(0);
 
         testEntries.add( entry );
 
@@ -203,7 +206,7 @@
         configuration.setTestEntries( testEntries );
         configuration.setShutdownHookEnabled( false );
         doDelete( configuration.getWorkingDirectory() );
-        setSysRoot( username, password, configuration );
+        setContextRoots( username, password, configuration );
     }
 
 
@@ -236,13 +239,13 @@
      * @return the sysRoot context which is also set
      * @throws NamingException if there is a failure of any kind
      */
-    protected LdapContext setSysRoot( String user, String passwd, Configuration cfg ) throws NamingException
+    protected void setContextRoots( String user, String passwd, Configuration cfg ) throws NamingException
     {
         Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.SECURITY_PRINCIPAL, user );
         env.put( Context.SECURITY_CREDENTIALS, passwd );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
-        return setSysRoot( env );
+        setContextRoots( env );
     }
 
 
@@ -255,7 +258,7 @@
      * @return the sysRoot context which is also set
      * @throws NamingException if there is a failure of any kind
      */
-    protected LdapContext setSysRoot( Hashtable env ) throws NamingException
+    protected void setContextRoots( Hashtable env ) throws NamingException
     {
         Hashtable envFinal = new Hashtable( env );
         if ( !envFinal.containsKey( Context.PROVIDER_URL ) )
@@ -274,7 +277,9 @@
         new InitialLdapContext( adminEnv, null );
 
         // OK, now let's get an appropriate context.
-        return sysRoot = new InitialLdapContext( envFinal, null );
+        sysRoot = new InitialLdapContext( envFinal, null );
+        envFinal.put( Context.PROVIDER_URL, "ou=schema" );
+        schemaRoot = new InitialLdapContext( envFinal, null );
     }
 
 
@@ -303,7 +308,7 @@
     {
         super.tearDown();
 
-        Hashtable env = new Hashtable();
+        Hashtable<String,Object> env = new Hashtable<String,Object>();
 
         env.put( Context.PROVIDER_URL, "ou=system" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java Sun Dec 31 11:46:40 2006
@@ -25,15 +25,17 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
+import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
 import org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration;
-import org.apache.directory.server.core.schema.bootstrap.NisSchema;
 import org.apache.directory.server.core.unit.AbstractAdminTestCase;
 
 
@@ -55,18 +57,10 @@
     }
     
     
+    @SuppressWarnings("unchecked")
     public void setUp() throws Exception
     {
         // -------------------------------------------------------------------
-        // Alter the system configuration to include the NisSchema
-        // -------------------------------------------------------------------
-
-        Set schemas = new HashSet();
-        schemas.addAll( configuration.getBootstrapSchemas() );
-        schemas.add( new NisSchema() );
-        configuration.setBootstrapSchemas( schemas );
-        
-        // -------------------------------------------------------------------
         // Alter the partition configuration to index gidNumber
         // -------------------------------------------------------------------
 
@@ -89,6 +83,27 @@
         }
         
         super.setUp();
+
+        // -------------------------------------------------------------------
+        // Enable the nis schema
+        // -------------------------------------------------------------------
+
+        // check if nis is disabled
+        Attributes nisAttrs = schemaRoot.getAttributes( "cn=nis" );
+        boolean isNisDisabled = false;
+        if ( nisAttrs.get( "m-disabled" ) != null )
+        {
+            isNisDisabled = ( ( String ) nisAttrs.get( "m-disabled" ).get() ).equalsIgnoreCase( "TRUE" );
+        }
+        
+        // if nis is disabled then enable it
+        if ( isNisDisabled )
+        {
+            Attribute disabled = new BasicAttribute( "m-disabled" );
+            ModificationItem[] mods = new ModificationItem[] { 
+                new ModificationItem( DirContext.REMOVE_ATTRIBUTE, disabled ) };
+            schemaRoot.modifyAttributes( "cn=nis", mods );
+        }
         
         // -------------------------------------------------------------------
         // Add a bunch of nis groups
@@ -108,7 +123,7 @@
      */
     public Set searchGroups( String filter ) throws NamingException
     {
-        Set results = new HashSet();
+        Set<String> results = new HashSet<String>();
         NamingEnumeration list = sysRoot.search( "ou=groups", filter, new SearchControls() );
         while( list.hasMore() )
         {

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java Sun Dec 31 11:46:40 2006
@@ -185,7 +185,7 @@
         configuration.setAllowAnonymousAccess( false );
         try
         {
-            setSysRoot( env );
+            setContextRoots( env );
             fail( "should not get here due to exception" );
         }
         catch ( LdapNoPermissionException e )
@@ -198,8 +198,8 @@
         env.put( Context.SECURITY_AUTHENTICATION, "none" );
         configuration.setAllowAnonymousAccess( true );
 
-        InitialLdapContext ctx = ( InitialLdapContext ) setSysRoot( env );
-        assertNotNull( ctx );
+        setContextRoots( env );
+        assertNotNull( sysRoot );
 
         // now go in as anonymous user and we should be wh
         env.put( Context.PROVIDER_URL, "ou=system" );
@@ -242,7 +242,7 @@
 
         try
         {
-            setSysRoot( env );
+            setContextRoots( env );
             fail( "should not get here due to exception" );
         }
         catch ( ConfigurationException e )
@@ -271,7 +271,7 @@
 
         try
         {
-            setSysRoot( env );
+            setContextRoots( env );
             fail( "should not get here due to exception" );
         }
         catch ( ConfigurationException e )

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java Sun Dec 31 11:46:40 2006
@@ -70,7 +70,7 @@
         Set partitions = new HashSet();
         partitions.add( partition );
 
-        configuration.setContextPartitionConfigurations( partitions );
+        configuration.setPartitionConfigurations( partitions );
         super.overrideEnvironment( Context.PROVIDER_URL, suffix );
 
         super.setUp();

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/ShutdownITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/ShutdownITest.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/ShutdownITest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/ShutdownITest.java Sun Dec 31 11:46:40 2006
@@ -47,7 +47,7 @@
      */
     public void testShutdownNonNullContext() throws Exception
     {
-        setSysRoot( "uid=admin,ou=system", "secret", new ShutdownConfiguration() );
+        setContextRoots( "uid=admin,ou=system", "secret", new ShutdownConfiguration() );
         assertNotNull( sysRoot );
         doDelete( configuration.getWorkingDirectory() );
     }
@@ -60,11 +60,11 @@
      */
     public void testShutdownRestart() throws Exception
     {
-        setSysRoot( "uid=admin,ou=system", "secret", new ShutdownConfiguration() );
+        setContextRoots( "uid=admin,ou=system", "secret", new ShutdownConfiguration() );
         assertNotNull( sysRoot );
 
         // restart the system now
-        setSysRoot( "uid=admin,ou=system", "secret", configuration );
+        setContextRoots( "uid=admin,ou=system", "secret", configuration );
 
         // (tearDown is overriden)
         super.tearDown();

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/SyncITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/SyncITest.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/SyncITest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/SyncITest.java Sun Dec 31 11:46:40 2006
@@ -42,7 +42,7 @@
      */
     public void testSyncNoException() throws Exception
     {
-        sysRoot = setSysRoot( "uid=admin,ou=system", "secret", new SyncConfiguration() );
+        setContextRoots( "uid=admin,ou=system", "secret", new SyncConfiguration() );
         assertNotNull( sysRoot );
     }
 
@@ -55,7 +55,7 @@
      */
     public void testPostSyncLookup() throws Exception
     {
-        sysRoot = setSysRoot( "uid=admin,ou=system", "secret", new SyncConfiguration() );
+        setContextRoots( "uid=admin,ou=system", "secret", new SyncConfiguration() );
 
         Attributes users = sysRoot.getAttributes( "ou=users" );
 

Modified: directory/trunks/apacheds/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/pom.xml?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/pom.xml (original)
+++ directory/trunks/apacheds/core/pom.xml Sun Dec 31 11:46:40 2006
@@ -26,142 +26,59 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>jdbm</groupId>
-      <artifactId>jdbm</artifactId>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-bootstrap</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-registries</artifactId>
+      <version>${pom.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-shared</artifactId>
       <version>${pom.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-utils</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-jdbm-store</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-constants</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-btree-base</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-bootstrap-partition</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.directory.server</groupId>
-        <artifactId>apacheds-core-plugin</artifactId>
-        <configuration>
-          <schemaSourcesDir>src/main/schema</schemaSourcesDir>
-          <schemas>
-            <schema>
-              <name>apache</name>
-              <dependencies>
-                <dependency>system</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>apachemeta</name>
-              <dependencies>
-                <dependency>system</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>apachedns</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>autofs</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-                <dependency>cosine</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>collective</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>corba</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>core</name>
-              <dependencies>
-                <dependency>system</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>cosine</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>inetorgperson</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-                <dependency>cosine</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>java</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>krb5kdc</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>nis</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-                <dependency>cosine</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>system</name>
-            </schema>
-            <schema>
-              <name>mozilla</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>dhcp</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-              </dependencies>
-            </schema>
-            <schema>
-              <name>samba</name>
-              <dependencies>
-                <dependency>system</dependency>
-                <dependency>core</dependency>
-                <dependency>inetorgperson</dependency>
-                <dependency>nis</dependency>
-              </dependencies>
-            </schema>
-          </schemas>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration> 
+          <systemProperties>
+            <property>
+              <name>workingDirectory</name>
+              <value>${basedir}/target/server-work</value>
+            </property>
+          </systemProperties>
         </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>generate</goal>
-            </goals>
-          </execution>
-        </executions>
       </plugin>
     </plugins>
     <resources>

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sun Dec 31 11:46:40 2006
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core;
 
 
+import java.io.IOException;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Map;
@@ -34,6 +35,8 @@
 import org.apache.directory.server.core.authz.AuthorizationService;
 import org.apache.directory.server.core.configuration.Configuration;
 import org.apache.directory.server.core.configuration.ConfigurationException;
+import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
+import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.configuration.StartupConfiguration;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.jndi.AbstractContextFactory;
@@ -42,10 +45,21 @@
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.core.partition.DefaultPartitionNexus;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.bootstrap.BootstrapRegistries;
-import org.apache.directory.server.core.schema.bootstrap.BootstrapSchemaLoader;
-import org.apache.directory.server.core.schema.global.GlobalRegistries;
+import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.server.core.schema.PartitionSchemaLoader;
+import org.apache.directory.server.core.schema.SchemaManager;
+import org.apache.directory.server.core.schema.SchemaPartitionDao;
+import org.apache.directory.server.schema.SerializableComparator;
+import org.apache.directory.server.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.schema.bootstrap.ApachemetaSchema;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.partition.SchemaPartitionExtractor;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
@@ -77,6 +91,8 @@
     private final DirectoryServiceConfiguration configuration = new DefaultDirectoryServiceConfiguration( this );
 
     private DirectoryServiceListener serviceListener;
+    
+    private SchemaManager schemaManager;
 
     /** the initial context environment that fired up the backend subsystem */
     private Hashtable<String, Object> environment;
@@ -85,7 +101,7 @@
     private StartupConfiguration startupConfiguration;
 
     /** the registries for system schema objects */
-    private GlobalRegistries globalRegistries;
+    private Registries registries;
 
     /** the root nexus */
     private DefaultPartitionNexus partitionNexus;
@@ -107,7 +123,7 @@
     /**
      * Creates a new instance.
      */
-    public DefaultDirectoryService(String instanceId)
+    public DefaultDirectoryService( String instanceId )
     {
         if ( instanceId == null )
         {
@@ -315,9 +331,9 @@
     }
 
 
-    public GlobalRegistries getGlobalRegistries()
+    public Registries getRegistries()
     {
-        return globalRegistries;
+        return registries;
     }
 
 
@@ -459,7 +475,7 @@
         // create system users area
         // -------------------------------------------------------------------
 
-        Map oidsMap = configuration.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+        Map oidsMap = configuration.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
         LdapDN userDn = new LdapDN( "ou=users,ou=system" );
         userDn.normalize( oidsMap );
         
@@ -665,7 +681,7 @@
         boolean needToChangeAdminPassword = false;
 
         LdapDN adminDn = new LdapDN( PartitionNexus.ADMIN_PRINCIPAL );
-        adminDn.normalize( configuration.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
+        adminDn.normalize( configuration.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
         
         Attributes adminEntry = partitionNexus.lookup( adminDn );
         Object userPassword = adminEntry.get( "userPassword" ).get();
@@ -736,24 +752,126 @@
         }
 
         // --------------------------------------------------------------------
-        // Load the schema here and check that it is ok!
+        // Load the bootstrap schemas to start up the schema partition
         // --------------------------------------------------------------------
 
-        BootstrapRegistries bootstrapRegistries = new BootstrapRegistries();
+        // setup temporary loader and temp registry 
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        loader.load( startupConfiguration.getBootstrapSchemas(), bootstrapRegistries );
+        registries = new DefaultRegistries( "bootstrap", loader );
+        
+        // load essential bootstrap schemas 
+        Set<Schema> bootstrapSchemas = new HashSet<Schema>();
+        bootstrapSchemas.add( new ApachemetaSchema() );
+        bootstrapSchemas.add( new ApacheSchema() );
+        bootstrapSchemas.add( new CoreSchema() );
+        bootstrapSchemas.add( new SystemSchema() );
+        loader.loadWithDependencies( bootstrapSchemas, registries );
 
-        java.util.List errors = bootstrapRegistries.checkRefInteg();
+        // run referential integrity tests
+        java.util.List errors = registries.checkRefInteg();
         if ( !errors.isEmpty() )
         {
             NamingException e = new NamingException();
-
             e.setRootCause( ( Throwable ) errors.get( 0 ) );
-
             throw e;
         }
+        
+        SerializableComparator.setRegistry( registries.getComparatorRegistry() );
+        
+        // --------------------------------------------------------------------
+        // If not present extract schema partition from jar
+        // --------------------------------------------------------------------
 
-        globalRegistries = new GlobalRegistries( bootstrapRegistries );
+        SchemaPartitionExtractor extractor = null; 
+        try
+        {
+            extractor = new SchemaPartitionExtractor( startupConfiguration.getWorkingDirectory() );
+            extractor.extract();
+        }
+        catch ( IOException e )
+        {
+            NamingException ne = new NamingException( "Failed to extract pre-loaded schema partition." );
+            ne.setRootCause( e );
+            throw ne;
+        }
+        
+        // --------------------------------------------------------------------
+        // Initialize schema partition
+        // --------------------------------------------------------------------
+        
+        MutablePartitionConfiguration schemaPartitionConfig = new MutablePartitionConfiguration();
+        schemaPartitionConfig.setName( "schema" );
+        schemaPartitionConfig.setCacheSize( 1000 );
+        schemaPartitionConfig.setIndexedAttributes( extractor.getDbFileListing().getIndexedAttributes() );
+        schemaPartitionConfig.setOptimizerEnabled( true );
+        schemaPartitionConfig.setSuffix( "ou=schema" );
+        
+        Attributes entry = new LockableAttributesImpl();
+        entry.put( "objectClass", "top" );
+        entry.get( "objectClass" ).add( "organizationalUnit" );
+        entry.put( "ou", "schema" );
+        schemaPartitionConfig.setContextEntry( entry );
+        JdbmPartition schemaPartition = new JdbmPartition();
+        schemaPartition.init( configuration, schemaPartitionConfig );
+        schemaPartitionConfig.setContextPartition( schemaPartition );
+
+        // --------------------------------------------------------------------
+        // Enable schemas of all indices of partition configurations 
+        // --------------------------------------------------------------------
+
+        /*
+         * We need to make sure that every attribute indexed by a partition is
+         * loaded into the registries on the next step.  So here we must enable
+         * the schemas of those attributes so they are loaded into the global
+         * registries.
+         */
+        
+        SchemaPartitionDao dao = new SchemaPartitionDao( schemaPartition, registries );
+        Map<String,Schema> schemaMap = dao.getSchemas();
+        PartitionConfiguration pc = startupConfiguration.getSystemPartitionConfiguration();
+        Set<PartitionConfiguration> pcs = new HashSet<PartitionConfiguration>();
+        if ( pc != null )
+        {
+            pcs.add( pc );
+        }
+        else
+        {
+            log.warn( "Encountered null configuration." );
+        }
+            
+        
+        pcs.addAll( startupConfiguration.getPartitionConfigurations() );
+        
+        for ( PartitionConfiguration pconf : pcs )
+        {
+            Iterator indices = pconf.getIndexedAttributes().iterator();
+            while ( indices.hasNext() )
+            {
+                Object indexedAttr = indices.next();
+                String schemaName = dao.findSchema( indexedAttr.toString() );
+                if ( schemaName == null )
+                {
+                    throw new NamingException( "Index on unidentified attribute" );
+                }
+                
+                Schema schema = schemaMap.get( schemaName );
+                if ( schema.isDisabled() )
+                {
+                    dao.enableSchema( schemaName );
+                }
+            }
+        }
+        
+        // --------------------------------------------------------------------
+        // Initialize schema subsystem and reset registries
+        // --------------------------------------------------------------------
+        
+        PartitionSchemaLoader schemaLoader = new PartitionSchemaLoader( schemaPartition, registries );
+        Registries globalRegistries = new DefaultRegistries( "global", schemaLoader );
+        schemaLoader.loadEnabled( globalRegistries );
+        registries = globalRegistries;
+        SerializableComparator.setRegistry( globalRegistries.getComparatorRegistry() );
+        
         Set<String> binaries = new HashSet<String>();
         if ( this.environment.containsKey( BINARY_KEY ) )
         {
@@ -790,13 +908,16 @@
                 }
             }
         }
+        
+        schemaManager = new SchemaManager( globalRegistries, schemaLoader );
 
         // now get all the attributeTypes that are binary from the registry
-        AttributeTypeRegistry registry = globalRegistries.getAttributeTypeRegistry();
+        AttributeTypeRegistry registry = registries.getAttributeTypeRegistry();
         Iterator list = registry.list();
         while ( list.hasNext() )
         {
             AttributeType type = ( AttributeType ) list.next();
+            
             if ( !type.getSyntax().isHumanReadible() )
             {
                 // add the OID for the attributeType
@@ -819,6 +940,7 @@
 
         partitionNexus = new DefaultPartitionNexus( new LockableAttributesImpl() );
         partitionNexus.init( configuration, null );
+        partitionNexus.addContextPartition( schemaPartitionConfig );
 
         interceptorChain = new InterceptorChain();
         interceptorChain.init( configuration );
@@ -827,5 +949,11 @@
         {
             log.debug( "<--- DefaultDirectoryService initialized" );
         }
+    }
+
+
+    public SchemaManager getSchemaManager()
+    {
+        return schemaManager;
     }
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java Sun Dec 31 11:46:40 2006
@@ -28,7 +28,8 @@
 import org.apache.directory.server.core.configuration.StartupConfiguration;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.schema.global.GlobalRegistries;
+import org.apache.directory.server.core.schema.SchemaManager;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -79,9 +80,9 @@
     }
 
 
-    public GlobalRegistries getGlobalRegistries()
+    public Registries getRegistries()
     {
-        return parent.getGlobalRegistries();
+        return parent.getRegistries();
     }
 
 
@@ -113,5 +114,11 @@
         String authentication, String baseName ) throws NamingException
     {
         return parent.getJndiContext( principalDn, principal, credential, authentication, baseName );
+    }
+
+
+    public SchemaManager getSchemaManager()
+    {
+        return parent.getSchemaManager();
     }
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java Sun Dec 31 11:46:40 2006
@@ -27,7 +27,8 @@
 import org.apache.directory.server.core.configuration.StartupConfiguration;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.schema.global.GlobalRegistries;
+import org.apache.directory.server.core.schema.SchemaManager;
+import org.apache.directory.server.schema.registries.Registries;
 
 
 /**
@@ -72,7 +73,7 @@
     /**
      * Returns the registries for system schema objects of the {@link DirectoryService}.
      */
-    GlobalRegistries getGlobalRegistries();
+    Registries getRegistries();
 
 
     /**
@@ -87,6 +88,10 @@
      */
     InterceptorChain getInterceptorChain();
 
+    /**
+     * Returns the schema manager for the {@link DirectoryService}.
+     */
+    SchemaManager getSchemaManager();
 
     /**
      * Returns <tt>true</tt> if this service is started

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java Sun Dec 31 11:46:40 2006
@@ -35,10 +35,10 @@
 import org.apache.directory.server.core.jndi.ServerContext;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
-import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.subtree.SubentryService;
+import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.aci.ACIItem;
 import org.apache.directory.shared.ldap.aci.ACIItemParser;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -166,8 +166,8 @@
         super.init( factoryCfg, cfg );
         tupleCache = new TupleCache( factoryCfg );
         groupCache = new GroupCache( factoryCfg );
-        attrRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
-        OidRegistry oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
+        attrRegistry = factoryCfg.getRegistries().getAttributeTypeRegistry();
+        OidRegistry oidRegistry = factoryCfg.getRegistries().getOidRegistry();
         
         // look up some constant information
         objectClassOid = oidRegistry.getOid( "objectClass" );
@@ -177,7 +177,7 @@
         acSubentryType = attrRegistry.lookup( acSubentryOid );
         
         aciParser = new ACIItemParser( new ConcreteNameComponentNormalizer( attrRegistry, oidRegistry ), attrRegistry.getNormalizerMapping() );
-        engine = new ACDFEngine( factoryCfg.getGlobalRegistries().getOidRegistry(), attrRegistry );
+        engine = new ACDFEngine( factoryCfg.getRegistries().getOidRegistry(), attrRegistry );
         chain = factoryCfg.getInterceptorChain();
         enabled = factoryCfg.getStartupConfiguration().isAccessControlEnabled();
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java Sun Dec 31 11:46:40 2006
@@ -102,7 +102,7 @@
     public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
     {
         nexus = factoryCfg.getPartitionNexus();
-        normalizerMapping = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+        normalizerMapping = factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
 
         // disable this static module if basic access control mechanisms are enabled
         enabled = !factoryCfg.getStartupConfiguration().isAccessControlEnabled();

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Sun Dec 31 11:46:40 2006
@@ -82,7 +82,7 @@
      */
     public GroupCache( DirectoryServiceConfiguration factoryCfg ) throws NamingException
     {
-    	normalizerMap = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+    	normalizerMap = factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
         this.nexus = factoryCfg.getPartitionNexus();
         this.env = ( Hashtable ) factoryCfg.getEnvironment().clone();
         

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Sun Dec 31 11:46:40 2006
@@ -34,9 +34,9 @@
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.aci.ACIItem;
 import org.apache.directory.shared.ldap.aci.ACIItemParser;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
@@ -91,10 +91,10 @@
      */
     public TupleCache(DirectoryServiceConfiguration factoryCfg) throws NamingException
     {
-    	normalizerMap = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+    	normalizerMap = factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
         this.nexus = factoryCfg.getPartitionNexus();
-        AttributeTypeRegistry attributeRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
-        OidRegistry oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
+        AttributeTypeRegistry attributeRegistry = factoryCfg.getRegistries().getAttributeTypeRegistry();
+        OidRegistry oidRegistry = factoryCfg.getRegistries().getOidRegistry();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry, oidRegistry );
         aciParser = new ACIItemParser( ncn, normalizerMap );
         env = ( Hashtable ) factoryCfg.getEnvironment().clone();

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java Sun Dec 31 11:46:40 2006
@@ -28,11 +28,11 @@
 import org.apache.directory.server.core.event.Evaluator;
 import org.apache.directory.server.core.event.ExpressionEvaluator;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
 import org.apache.directory.server.core.subtree.SubtreeEvaluator;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java Sun Dec 31 11:46:40 2006
@@ -30,9 +30,9 @@
 import org.apache.directory.server.core.ServerUtils;
 import org.apache.directory.server.core.event.Evaluator;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java Sun Dec 31 11:46:40 2006
@@ -29,8 +29,8 @@
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
 import org.apache.directory.server.core.subtree.SubentryService;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -81,7 +81,7 @@
     {
         super.init( factoryCfg, cfg );
         nexus = factoryCfg.getPartitionNexus();
-        registry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
+        registry = factoryCfg.getRegistries().getAttributeTypeRegistry();
     }
 
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java Sun Dec 31 11:46:40 2006
@@ -92,15 +92,9 @@
     }
 
 
-    public void setBootstrapSchemas( Set bootstrapSchemas )
+    public void setPartitionConfigurations( Set paritionConfigurations )
     {
-        super.setBootstrapSchemas( bootstrapSchemas );
-    }
-
-
-    public void setContextPartitionConfigurations( Set contextParitionConfigurations )
-    {
-        super.setContextPartitionConfigurations( contextParitionConfigurations );
+        super.setPartitionConfigurations( paritionConfigurations );
     }
 
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java Sun Dec 31 11:46:40 2006
@@ -30,7 +30,7 @@
 
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.server.core.schema.MatchingRuleRegistry;
+import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.Normalizer;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java Sun Dec 31 11:46:40 2006
@@ -42,14 +42,6 @@
 import org.apache.directory.server.core.operational.OperationalAttributeService;
 import org.apache.directory.server.core.referral.ReferralService;
 import org.apache.directory.server.core.schema.SchemaService;
-import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
-import org.apache.directory.server.core.schema.bootstrap.BootstrapSchema;
-import org.apache.directory.server.core.schema.bootstrap.CollectiveSchema;
-import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
-import org.apache.directory.server.core.schema.bootstrap.CosineSchema;
-import org.apache.directory.server.core.schema.bootstrap.InetorgpersonSchema;
-import org.apache.directory.server.core.schema.bootstrap.JavaSchema;
-import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.core.trigger.TriggerService;
 import org.apache.directory.shared.ldap.ldif.Entry;
@@ -81,8 +73,7 @@
     private Set authenticatorConfigurations; // Set<AuthenticatorConfiguration>
     private List interceptorConfigurations; // Set<InterceptorConfiguration>
     private PartitionConfiguration systemPartitionConfiguration; 
-    private Set bootstrapSchemas; // Set<BootstrapSchema>
-    private Set contextPartitionConfigurations = new HashSet(); // Set<ContextPartitionConfiguration>
+    private Set<PartitionConfiguration> partitionConfigurations = new HashSet<PartitionConfiguration>();
     private List testEntries = new ArrayList(); // List<Attributes>
 
 
@@ -92,7 +83,6 @@
     public StartupConfiguration()
     {
         setDefaultAuthenticatorConfigurations();
-        setDefaultBootstrapSchemas();
         setDefaultInterceptorConfigurations();
     }
 
@@ -104,7 +94,6 @@
     public StartupConfiguration(String instanceId)
     {
         setDefaultAuthenticatorConfigurations();
-        setDefaultBootstrapSchemas();
         setDefaultInterceptorConfigurations();
         setInstanceId( instanceId );
     }
@@ -135,24 +124,6 @@
     }
 
 
-    private void setDefaultBootstrapSchemas()
-    {
-        Set set;
-        // Set default bootstrap schemas
-        set = new HashSet();
-
-        set.add( new CoreSchema() );
-        set.add( new CosineSchema() );
-        set.add( new ApacheSchema() );
-        set.add( new InetorgpersonSchema() );
-        set.add( new JavaSchema() );
-        set.add( new SystemSchema() );
-        set.add( new CollectiveSchema() );
-
-        setBootstrapSchemas( set );
-    }
-
-
     private void setDefaultInterceptorConfigurations()
     {
         // Set default interceptor chains
@@ -259,36 +230,18 @@
 
 
     /**
-     * Returns {@link BootstrapSchema}s to load while bootstrapping.
-     */
-    public Set getBootstrapSchemas()
-    {
-        return ConfigurationUtil.getClonedSet( bootstrapSchemas );
-    }
-
-
-    /**
-     * Sets {@link BootstrapSchema}s to load while bootstrapping.
-     */
-    protected void setBootstrapSchemas( Set bootstrapSchemas )
-    {
-        this.bootstrapSchemas = ConfigurationUtil.getTypeSafeSet( bootstrapSchemas, BootstrapSchema.class );
-    }
-
-
-    /**
      * Returns {@link PartitionConfiguration}s to configure context partitions.
      */
-    public Set getContextPartitionConfigurations()
+    public Set<PartitionConfiguration> getPartitionConfigurations()
     {
-        return ConfigurationUtil.getClonedSet( contextPartitionConfigurations );
+        return ConfigurationUtil.getClonedSet( partitionConfigurations );
     }
 
 
     /**
      * Sets {@link PartitionConfiguration}s to configure context partitions.
      */
-    protected void setContextPartitionConfigurations( Set contextParitionConfigurations )
+    protected void setPartitionConfigurations( Set contextParitionConfigurations )
     {
         Set newSet = ConfigurationUtil.getTypeSafeSet( contextParitionConfigurations,
             PartitionConfiguration.class );
@@ -308,7 +261,7 @@
             names.add( name );
         }
 
-        this.contextPartitionConfigurations = newSet;
+        this.partitionConfigurations = newSet;
     }
 
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java Sun Dec 31 11:46:40 2006
@@ -33,7 +33,7 @@
 
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.referral.ReferralLut;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.exception.LdapReferralException;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java Sun Dec 31 11:46:40 2006
@@ -29,9 +29,9 @@
 import org.apache.directory.server.core.normalization.NormalizingVisitor;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -77,12 +77,12 @@
     {
         super.init( factoryCfg, cfg );
 
-        OidRegistry oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
-        attributeRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
+        OidRegistry oidRegistry = factoryCfg.getRegistries().getOidRegistry();
+        attributeRegistry = factoryCfg.getRegistries().getAttributeTypeRegistry();
         evaluator = new ExpressionEvaluator( oidRegistry, attributeRegistry );
         nexus = factoryCfg.getPartitionNexus();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry, oidRegistry );
-        visitor = new NormalizingVisitor( ncn, factoryCfg.getGlobalRegistries().getOidRegistry() );
+        visitor = new NormalizingVisitor( ncn, factoryCfg.getRegistries().getOidRegistry() );
     }
 
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java Sun Dec 31 11:46:40 2006
@@ -25,8 +25,8 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java Sun Dec 31 11:46:40 2006
@@ -28,8 +28,8 @@
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.server.core.ServerUtils;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.LeafNode;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java Sun Dec 31 11:46:40 2006
@@ -28,8 +28,8 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java Sun Dec 31 11:46:40 2006
@@ -71,7 +71,7 @@
     public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
     {
         nexus = factoryCfg.getPartitionNexus();
-        normalizerMap = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+        normalizerMap = factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
         Attribute attr = nexus.getRootDSE().get( "subschemaSubentry" );
         subschemSubentryDn = new LdapDN( ( String ) attr.get() );
         subschemSubentryDn.normalize( normalizerMap );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java Sun Dec 31 11:46:40 2006
@@ -25,7 +25,7 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java Sun Dec 31 11:46:40 2006
@@ -36,9 +36,9 @@
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
@@ -80,8 +80,8 @@
 
     public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
     {
-        OidRegistry oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
-        attributeRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
+        OidRegistry oidRegistry = factoryCfg.getRegistries().getOidRegistry();
+        attributeRegistry = factoryCfg.getRegistries().getAttributeTypeRegistry();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry, oidRegistry );
         normVisitor = new NormalizingVisitor( ncn, oidRegistry );
         expVisitor = new ExpandingVisitor( attributeRegistry );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java Sun Dec 31 11:46:40 2006
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.normalization;
 
 
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java Sun Dec 31 11:46:40 2006
@@ -46,7 +46,7 @@
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
@@ -120,7 +120,7 @@
     public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
     {
         nexus = factoryCfg.getPartitionNexus();
-        registry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
+        registry = factoryCfg.getRegistries().getAttributeTypeRegistry();
         isDenormalizeOpAttrsEnabled = factoryCfg.getStartupConfiguration().isDenormalizeOpAttrsEnabled();
     }
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java Sun Dec 31 11:46:40 2006
@@ -170,7 +170,7 @@
         if ( suffixDn == null )
         {
             suffixDn = new LdapDN( cfg.getSuffix() );
-            suffixDn.normalize( factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
+            suffixDn.normalize( factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
         }
 
         return suffixDn;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Sun Dec 31 11:46:40 2006
@@ -47,8 +47,8 @@
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.MultiException;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeIdentifierException;
@@ -193,13 +193,13 @@
         }
 
         this.factoryCfg = factoryCfg;
-        this.attrRegistry = this.factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
-        this.oidRegistry = this.factoryCfg.getGlobalRegistries().getOidRegistry();
+        this.attrRegistry = this.factoryCfg.getRegistries().getAttributeTypeRegistry();
+        this.oidRegistry = this.factoryCfg.getRegistries().getOidRegistry();
         
         List<PartitionConfiguration> initializedPartitionCfgs = new ArrayList<PartitionConfiguration>();
         initializedPartitionCfgs.add( initializeSystemPartition() );
 
-        Iterator i = factoryCfg.getStartupConfiguration().getContextPartitionConfigurations().iterator();
+        Iterator i = factoryCfg.getStartupConfiguration().getPartitionConfigurations().iterator();
         try
         {
             while ( i.hasNext() )
@@ -278,12 +278,12 @@
             }
             
             // add all attribute oids of index configs to a hashset
-            Set<String> indices = systemCfg.getIndexedAttributes();
+            Set indices = systemCfg.getIndexedAttributes();
             Set<String> indexOids = new HashSet<String>();
-            OidRegistry registry = factoryCfg.getGlobalRegistries().getOidRegistry();
-            for ( Iterator ii = indices.iterator(); ii.hasNext(); /**/ )
+            OidRegistry registry = factoryCfg.getRegistries().getOidRegistry();
+            for ( Object index : indices )
             {
-                indexOids.add( registry.getOid( ii.next().toString() ) );
+                indexOids.add( registry.getOid( index.toString() ) );
             }
             
             if ( ! indexOids.contains( Oid.ALIAS ) )
@@ -454,7 +454,7 @@
     public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
     {
         Partition partition = getBackend( name );
-        AttributeTypeRegistry registry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
+        AttributeTypeRegistry registry = factoryCfg.getRegistries().getAttributeTypeRegistry();
 
         // complain if we do not recognize the attribute being compared
         if ( !registry.hasAttributeType( oid ) )
@@ -527,7 +527,11 @@
             throw new ConfigurationException( "Duplicate partition suffix: " + key );
         }
 
-        partition.init( factoryCfg, config );
+        if ( ! partition.isInitialized() )
+        {
+            partition.init( factoryCfg, config );
+        }
+        
         partitions.put( partition.getSuffix().toString(), partition );
 
         Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Sun Dec 31 11:46:40 2006
@@ -184,7 +184,7 @@
      * <a href="http://java.sun.com/j2se/1.4.2/docs/api/
      * javax/naming/directory/SearchResult.html">SearchResult</a>.
      */
-    NamingEnumeration search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
+    NamingEnumeration<SearchResult> search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
         throws NamingException;
 
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Sun Dec 31 11:46:40 2006
@@ -39,9 +39,9 @@
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.Oid;
 import org.apache.directory.server.core.partition.impl.btree.gui.PartitionViewer;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.OidRegistry;
-import org.apache.directory.server.core.schema.Registries;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.OidRegistry;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.exception.LdapContextNotEmptyException;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -63,13 +63,10 @@
 {
     private static final Logger log = LoggerFactory.getLogger( BTreePartition.class );
 
-    /**
-     * the search engine used to search the database
-     */
+    /** the search engine used to search the database */
     private SearchEngine searchEngine = null;
     private Optimizer optimizer = new NoOpOptimizer();
     
-    protected BTreePartitionConfiguration btpConfig;
     protected AttributeTypeRegistry attributeTypeRegistry = null;
     protected OidRegistry oidRegistry = null;
 
@@ -94,7 +91,22 @@
      * 
      * @param registries the schema entity registries
      */
-    public void setRegistries( Registries registries )
+    public void initRegistries( Registries registries )
+    {
+        initRegistries1( registries );
+    }
+    
+    
+    /**
+     * This should be called second after initializing the optimizer with 
+     * initOptimizer0.  This is the same as calling initRegistries() 
+     * (initRegistries actually calls initRegistries1) except it is protected 
+     * to hide the '1' at the end of the method name.  The '1' indicates it 
+     * is the 2nd thing that must be executed during initialization.
+     * 
+     * @param registries the schema entity registries
+     */
+    protected void initRegistries1( Registries registries )
     {
         attributeTypeRegistry = registries.getAttributeTypeRegistry();
         oidRegistry = registries.getOidRegistry();
@@ -103,19 +115,17 @@
         this.searchEngine = new DefaultSearchEngine( this, evaluator, enumerator, optimizer );
     }
     
-
-    public void init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg )
-        throws NamingException
+    
+    /**
+     * Use this method to initialize the indices.  Only call this after
+     * the registries and the optimizer have been enabled.  The '2' at the end
+     * shows this is the 3rd init method called in the init sequence.
+     * 
+     * @param indices
+     * @throws NamingException
+     */
+    protected void initIndices2(Set indices ) throws NamingException
     {
-        this.btpConfig = BTreePartitionConfiguration.convert( cfg );
-        if ( this.btpConfig.isOptimizerEnabled() )
-        {
-            optimizer = new DefaultOptimizer( this );
-        }
-
-        // Call this ONLY after trying to override the optimizer default above
-        setRegistries( factoryCfg.getGlobalRegistries() );
-
         Set<String> sysOidSet = new HashSet<String>();
         sysOidSet.add( Oid.EXISTANCE );
         sysOidSet.add( Oid.HIERARCHY );
@@ -128,7 +138,7 @@
         // Used to calculate the system indices we must automatically add
         Set<String> customAddedSystemIndices = new HashSet<String>();
         
-        for ( Iterator ii = cfg.getIndexedAttributes().iterator(); ii.hasNext(); /**/ )
+        for ( Iterator ii = indices.iterator(); ii.hasNext(); /**/ )
         {
             /*
              * NOTE
@@ -299,15 +309,54 @@
                 }
             }
         }
+    }
 
+    
+    /**
+     * Called last (4th) to check if the suffix entry has been created on disk,
+     * and if not it is created.
+     *  
+     * @param suffix
+     * @param entry
+     * @throws NamingException
+     */
+    protected void initSuffixEntry3( String suffix, Attributes entry ) throws NamingException
+    {
         // add entry for context, if it does not exist
         Attributes suffixOnDisk = getSuffixEntry();
         if ( suffixOnDisk == null )
         {
-            LdapDN suffix = new LdapDN( cfg.getSuffix() );
-            LdapDN normalizedSuffix = LdapDN.normalize( suffix, attributeTypeRegistry.getNormalizerMapping() );
-            add( normalizedSuffix, cfg.getContextEntry() );
+            LdapDN dn = new LdapDN( suffix );
+            LdapDN normalizedSuffix = LdapDN.normalize( dn, attributeTypeRegistry.getNormalizerMapping() );
+            add( normalizedSuffix, entry );
         }
+    }
+
+    
+    /**
+     * Call this first in the init sequence to initialize the optimizer.
+     * 
+     * @param cfg
+     */
+    protected void initOptimizer0( PartitionConfiguration cfg )
+    {
+        if ( cfg instanceof BTreePartitionConfiguration )
+        {
+            if ( ( ( BTreePartitionConfiguration ) cfg ).isOptimizerEnabled() )
+            {
+                optimizer = new DefaultOptimizer( this );
+            }
+        }
+    }
+
+    
+    public void init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg )
+        throws NamingException
+    {
+        initOptimizer0( cfg );
+        initRegistries1( factoryCfg.getRegistries() );
+        initIndices2( cfg.getIndexedAttributes() );
+        initSuffixEntry3( cfg.getSuffix(), cfg.getContextEntry() );
     }
 
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?view=diff&rev=491471&r1=491470&r2=491471
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java Sun Dec 31 11:46:40 2006
@@ -26,7 +26,7 @@
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.UsageEnum;



Mime
View raw message