directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r470464 - in /directory/branches/apacheds-schema/apacheds/core: pom.xml src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
Date Thu, 02 Nov 2006 18:26:47 GMT
Author: elecharny
Date: Thu Nov  2 10:26:46 2006
New Revision: 470464

URL: http://svn.apache.org/viewvc?view=rev&rev=470464
Log:
Applied Norval patch for dynamic schemas
Modified the pom.xml to reflect this change 

Modified:
    directory/branches/apacheds-schema/apacheds/core/pom.xml
    directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java

Modified: directory/branches/apacheds-schema/apacheds/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/apacheds/core/pom.xml?view=diff&rev=470464&r1=470463&r2=470464
==============================================================================
--- directory/branches/apacheds-schema/apacheds/core/pom.xml (original)
+++ directory/branches/apacheds-schema/apacheds/core/pom.xml Thu Nov  2 10:26:46 2006
@@ -34,6 +34,11 @@
       <artifactId>apacheds-core-shared</artifactId>
       <version>${pom.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-plugin</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
   </dependencies>
   <build>
     <plugins>

Modified: directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?view=diff&rev=470464&r1=470463&r2=470464
==============================================================================
--- directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Thu Nov  2 10:26:46 2006
@@ -20,11 +20,7 @@
 package org.apache.directory.server.core;
 
 
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashSet;
+import java.util.*;
 
 import javax.naming.Context;
 import javax.naming.NamingException;
@@ -35,6 +31,7 @@
 import org.apache.directory.server.core.configuration.Configuration;
 import org.apache.directory.server.core.configuration.ConfigurationException;
 import org.apache.directory.server.core.configuration.StartupConfiguration;
+import org.apache.directory.server.core.configuration.SchemaLoader;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.jndi.AbstractContextFactory;
 import org.apache.directory.server.core.jndi.DeadContext;
@@ -526,7 +523,8 @@
 
             partitionNexus.add(normName, attributes );
             AuthorizationService authzSrvc = ( AuthorizationService ) interceptorChain.get(
"authorizationService" );
-            authzSrvc.cacheNewGroup( upName, normName, attributes );
+            if (authzSrvc != null)
+                authzSrvc.cacheNewGroup( upName, normName, attributes );
         }
 
         // -------------------------------------------------------------------
@@ -726,7 +724,7 @@
      *
      * @throws javax.naming.NamingException if there are problems along the way
      */
-    private void initialize() throws NamingException
+    protected void initialize() throws NamingException
     {
         if ( log.isDebugEnabled() )
         {
@@ -740,6 +738,16 @@
         BootstrapRegistries bootstrapRegistries = new BootstrapRegistries();
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
         loader.load( startupConfiguration.getBootstrapSchemas(), bootstrapRegistries );
+        if (startupConfiguration.getSchemaLoaders() != null)
+        {
+            for (Iterator it = startupConfiguration.getSchemaLoaders().iterator(); it.hasNext();)
+            {
+                final SchemaLoader     schemaLoader;
+
+                schemaLoader = (SchemaLoader) it.next();
+                schemaLoader.loadSchemas(startupConfiguration, bootstrapRegistries);
+            }
+        }
 
         java.util.List errors = bootstrapRegistries.checkRefInteg();
         if ( !errors.isEmpty() )

Modified: directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?view=diff&rev=470464&r1=470463&r2=470464
==============================================================================
--- directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
(original)
+++ directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
Thu Nov  2 10:26:46 2006
@@ -21,11 +21,7 @@
 
 
 import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 import javax.naming.directory.Attributes;
 
@@ -42,14 +38,7 @@
 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.schema.bootstrap.*;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.core.trigger.TriggerService;
 import org.apache.directory.shared.ldap.ldif.Entry;
@@ -80,12 +69,12 @@
     private int maxTimeLimit = MAX_TIME_LIMIT_DEFAULT; // set to default value (milliseconds)
     private Set authenticatorConfigurations; // Set<AuthenticatorConfiguration>
     private List interceptorConfigurations; // Set<InterceptorConfiguration>
-    private PartitionConfiguration systemPartitionConfiguration; 
+    private PartitionConfiguration systemPartitionConfiguration;
+    private List schemaLoaders;
     private Set bootstrapSchemas; // Set<BootstrapSchema>
     private Set contextPartitionConfigurations = new HashSet(); // Set<ContextPartitionConfiguration>
     private List testEntries = new ArrayList(); // List<Attributes>
 
-
     /**
      * Creates a new instance with default settings.
      */
@@ -257,6 +246,20 @@
         this.authenticatorConfigurations = newSet;
     }
 
+    /**
+     *   An optional list of {@link SchemaLoader}s which can be specified to load schemas
dynamically at server-startup.
+     *
+     * @return  The loader bean, if one has been configured.
+     */
+    public List getSchemaLoaders()
+    {
+        return schemaLoaders;
+    }
+
+    public void setSchemaLoaders(final List schemaLoaders)
+    {
+        this.schemaLoaders = schemaLoaders;
+    }
 
     /**
      * Returns {@link BootstrapSchema}s to load while bootstrapping.



Mime
View raw message