directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r530010 - in /directory/ldapstudio/trunk/ldapstudio-apacheds-configuration: ./ src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/ src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/ src/main/java...
Date Wed, 18 Apr 2007 13:17:38 GMT
Author: pamarcelot
Date: Wed Apr 18 06:17:37 2007
New Revision: 530010

URL: http://svn.apache.org/viewvc?view=rev&rev=530010
Log:
Refactored 'Apache DS' Menu.
Removed the 'Open Editor' menu item.
Refactored the 'New Configuration File' Action to use the default server.xml as template for
a new configuration file.
Added a method for parsing a Configuration file from an InputStream.

Added:
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/resources/org/apache/directory/ldapstudio/apacheds/configuration/default-server.xml
Removed:
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/OpenEditorAction.java
Modified:
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/plugin.xml
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/NewServerConfigurationAction.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/OpenServerConfigurationAction.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditorInput.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/plugin.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/plugin.xml?view=diff&rev=530010&r1=530009&r2=530010
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/plugin.xml (original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/plugin.xml Wed Apr 18 06:17:37
2007
@@ -29,22 +29,16 @@
                id="org.apache.directory.ldapstudio.apacheds.configuration.actionset.menu"
                label="Apache DS"/>
          <action
-               class="org.apache.directory.ldapstudio.apacheds.configuration.actions.OpenEditorAction"
-               id="org.apache.directory.ldapstudio.apacheds.configuration.openEditor"
-               label="Open Editor"
-               menubarPath="org.apache.directory.ldapstudio.apacheds.configuration.actionset.menu/open"
-               style="push"/>
-         <action
                class="org.apache.directory.ldapstudio.apacheds.configuration.actions.OpenServerConfigurationAction"
                id="org.apache.directory.ldapstudio.apacheds.configuration.openServerConfiguration"
-               label="Open..."
+               label="Open Configuration File..."
                menubarPath="org.apache.directory.ldapstudio.apacheds.configuration.actionset.menu/open"
                style="push"/>
          <action
                class="org.apache.directory.ldapstudio.apacheds.configuration.actions.NewServerConfigurationAction"
                id="org.apache.directory.ldapstudio.apacheds.configuration.newServerConfiguration"
-               label="New Configuration file"
-               menubarPath="org.apache.directory.ldapstudio.apacheds.configuration.actionset.menu/open"
+               label="New Configuration File"
+               menubarPath="org.apache.directory.ldapstudio.apacheds.configuration.actionset.menu/new"
                style="push"/>
       </actionSet>
    </extension>

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java?view=diff&rev=530010&r1=530009&r2=530010
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
Wed Apr 18 06:17:37 2007
@@ -28,6 +28,7 @@
  */
 public interface PluginConstants
 {
+    // Images
     public static final String IMG_VERTICAL_ORIENTATION = "icons/vertical_orientation.gif";
     public static final String IMG_HORIZONTAL_ORIENTATION = "icons/horizontal_orientation.gif";
     public static final String IMG_PARTITION = "icons/partition.gif";

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/NewServerConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/NewServerConfigurationAction.java?view=diff&rev=530010&r1=530009&r2=530010
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/NewServerConfigurationAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/NewServerConfigurationAction.java
Wed Apr 18 06:17:37 2007
@@ -1,23 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
 package org.apache.directory.ldapstudio.apacheds.configuration.actions;
 
 
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
-
 import org.apache.directory.ldapstudio.apacheds.configuration.Activator;
 import org.apache.directory.ldapstudio.apacheds.configuration.editor.ServerConfigurationEditor;
 import org.apache.directory.ldapstudio.apacheds.configuration.editor.ServerConfigurationEditorInput;
-import org.apache.directory.ldapstudio.apacheds.configuration.model.ExtendedOperation;
-import org.apache.directory.ldapstudio.apacheds.configuration.model.IndexedAttribute;
-import org.apache.directory.ldapstudio.apacheds.configuration.model.Interceptor;
-import org.apache.directory.ldapstudio.apacheds.configuration.model.Partition;
 import org.apache.directory.ldapstudio.apacheds.configuration.model.ServerConfiguration;
+import org.apache.directory.ldapstudio.apacheds.configuration.model.ServerConfigurationParser;
+import org.apache.directory.ldapstudio.apacheds.configuration.model.ServerConfigurationParserException;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
@@ -38,93 +52,22 @@
      */
     public void run( IAction action )
     {
-        // Creating the Default ServerConfiguration
-        ServerConfiguration serverConfiguration = new ServerConfiguration();
-
-        // General Settings
-        serverConfiguration.setAllowAnonymousAccess( false );
-        serverConfiguration.setEnableAccessControl( false );
-        serverConfiguration.setEnableChangePassword( false );
-        serverConfiguration.setEnableKerberos( false );
-        serverConfiguration.setEnableNTP( false );
-        serverConfiguration.setMaxSizeLimit( 1000 );
-        serverConfiguration.setMaxThreads( 8 );
-        serverConfiguration.setMaxTimeLimit( 15000 );
-        serverConfiguration.setPassword( "secret" );
-        serverConfiguration.setPort( 10389 );
-        serverConfiguration.setPrincipal( "uid=admin,ou=system" );
-        serverConfiguration.setSynchronizationPeriod( 15000 );
-
-        // System Partition
-        Partition partition = new Partition( "system" );
-        partition.setSuffix( "ou=system" );
-        Attributes attributes = new BasicAttributes( true );
-        Attribute attribute = new BasicAttribute( "objectClass" );
-        attribute.add( "top" );
-        attribute.add( "organizationalUnit" );
-        attribute.add( "extensibleObject" );
-        attributes.put( attribute );
-        attributes.put( new BasicAttribute( "ou", "system" ) );
-        partition.setContextEntry( attributes );
-        partition.setEnableOptimizer( true );
-        partition.setCacheSize( 100 );
-        partition.setSynchronizationOnWrite( true );
-        partition.addIndexedAttribute( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.1",
100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.2",
100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.3",
100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.4",
100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.5",
100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.6",
100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.7",
100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "ou", 100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "uid", 100 ) );
-        partition.addIndexedAttribute( new IndexedAttribute( "objectClass", 100 ) );
-        partition.setSystemPartition( true );
-        serverConfiguration.addPartition( partition );
-
-        // Interceptors
-        Interceptor interceptor = new Interceptor( "normalizationService" );
-        interceptor.setClassType( "org.apache.directory.server.core.normalization.NormalizationService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "authenticationService" );
-        interceptor.setClassType( "org.apache.directory.server.core.authn.AuthenticationService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "referralService" );
-        interceptor.setClassType( "org.apache.directory.server.core.referral.ReferralService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "authorizationService" );
-        interceptor.setClassType( "org.apache.directory.server.core.authz.AuthorizationService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "defaultAuthorizationService" );
-        interceptor.setClassType( "org.apache.directory.server.core.authz.DefaultAuthorizationService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "exceptionService" );
-        interceptor.setClassType( "org.apache.directory.server.core.exception.ExceptionService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "operationalAttributeService" );
-        interceptor.setClassType( "org.apache.directory.server.core.operational.OperationalAttributeService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "schemaService" );
-        interceptor.setClassType( "org.apache.directory.server.core.schema.SchemaService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "subentryService" );
-        interceptor.setClassType( "org.apache.directory.server.core.subtree.SubentryService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "collectiveAttributeService" );
-        interceptor.setClassType( "org.apache.directory.server.core.collective.CollectiveAttributeService"
);
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "eventService" );
-        interceptor.setClassType( "org.apache.directory.server.core.event.EventService" );
-        serverConfiguration.addInterceptor( interceptor );
-        interceptor = new Interceptor( "triggerService" );
-        interceptor.setClassType( "org.apache.directory.server.core.trigger.TriggerService"
);
-        serverConfiguration.addInterceptor( interceptor );
-
-        // Extended Operations
-        serverConfiguration.addExtendedOperation( new ExtendedOperation(
-            "org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler" )
);
-        serverConfiguration.addExtendedOperation( new ExtendedOperation(
-            "org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler"
) );
+        ServerConfigurationParser parser = new ServerConfigurationParser();
+        ServerConfiguration serverConfiguration = null;
+        
+        try
+        {
+            serverConfiguration = parser.parse( Activator.class.getResourceAsStream( "default-server.xml"
) );
+        }
+        catch ( ServerConfigurationParserException e )
+        {
+            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+                SWT.OK | SWT.ICON_ERROR );
+            messageBox.setText( "Error!" );
+            messageBox.setMessage( "An error occurred when reading the file." + "\n" + e.getMessage()
);
+            messageBox.open();
+            return;
+        }
 
         IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
         try
@@ -135,6 +78,7 @@
         {
             Activator.getDefault().getLog().log(
                 new Status( Status.ERROR, Activator.PLUGIN_ID, Status.OK, e.getMessage(),
e.getCause() ) );
+            return;
         }
     }
 

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/OpenServerConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/OpenServerConfigurationAction.java?view=diff&rev=530010&r1=530009&r2=530010
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/OpenServerConfigurationAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/actions/OpenServerConfigurationAction.java
Wed Apr 18 06:17:37 2007
@@ -1,3 +1,22 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
 package org.apache.directory.ldapstudio.apacheds.configuration.actions;
 
 

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditorInput.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditorInput.java?view=diff&rev=530010&r1=530009&r2=530010
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditorInput.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditorInput.java
Wed Apr 18 06:17:37 2007
@@ -70,7 +70,7 @@
         String path = serverConfiguration.getPath();
         if ( path == null )
         {
-            return "Unsaved Editor";
+            return "New Configuration File";
         }
         else
         {

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java?view=diff&rev=530010&r1=530009&r2=530010
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java
Wed Apr 18 06:17:37 2007
@@ -22,6 +22,7 @@
 
 import java.io.BufferedReader;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -36,7 +37,6 @@
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.dom4j.Attribute;
 import org.dom4j.Document;
-import org.dom4j.DocumentException;
 import org.dom4j.Element;
 import org.dom4j.io.SAXReader;
 
@@ -65,15 +65,13 @@
     {
         try
         {
-            Document document = parseAndGetDocument( path );
+            SAXReader reader = new SAXReader();
+            Document document = reader.read( path );
+
             ServerConfiguration serverConfiguration = new ServerConfiguration();
             serverConfiguration.setPath( path );
 
-            // Reading the 'Environment' Bean
-            readEnvironmentBean( document, serverConfiguration );
-
-            // Reading the 'Configuration' Bean
-            readConfigurationBean( document, serverConfiguration );
+            parse( document, serverConfiguration );
 
             return serverConfiguration;
         }
@@ -95,20 +93,65 @@
 
 
     /**
-     * Parses the ServerConfiguration File and get the associated DOM4J Document.
+     * Parses a 'server.xml' file located at the given path and returns 
+     * the corresponding ServerConfiguration Object.
      *
-     * @param path
-     *      the path of the file to parse
+     * @param inputStream
+     *      the Input Stream of the file to parse
      * @return
-     *      the associated Document
-     * @throws DocumentException
-     *      if an error occurrs during parsing
+     *      the corresponding ServerConfiguration Object
+     * @throws ServerConfigurationParserException
+     *      if an error occurrs when reading the Server Configuration file
+     */
+    public ServerConfiguration parse( InputStream inputStream ) throws ServerConfigurationParserException
+    {
+        try
+        {
+            SAXReader reader = new SAXReader();
+            Document document = reader.read( inputStream );
+
+            ServerConfiguration serverConfiguration = new ServerConfiguration();
+
+            parse( document, serverConfiguration );
+
+            return serverConfiguration;
+        }
+        catch ( Exception e )
+        {
+            if ( e instanceof ServerConfigurationParserException )
+            {
+                throw ( ServerConfigurationParserException ) e;
+            }
+            else
+            {
+                ServerConfigurationParserException exception = new ServerConfigurationParserException(
e.getMessage(),
+                    e.getCause() );
+                exception.setStackTrace( e.getStackTrace() );
+                throw exception;
+            }
+        }
+    }
+
+
+    /**
+     * Parses the Document.
+     *
+     * @param document
+     *      the Document
+     * @param serverConfiguration
+     *      the Server Configuration
+     * @throws NumberFormatException
+     * @throws BooleanFormatException
+     * @throws ServerConfigurationParserException
      */
-    private Document parseAndGetDocument( String path ) throws DocumentException
+    private void parse( Document document, ServerConfiguration serverConfiguration ) throws
NumberFormatException,
+        BooleanFormatException, ServerConfigurationParserException
     {
-        SAXReader reader = new SAXReader();
-        Document document = reader.read( path );
-        return document;
+        // Reading the 'Environment' Bean
+        readEnvironmentBean( document, serverConfiguration );
+
+        // Reading the 'Configuration' Bean
+        readConfigurationBean( document, serverConfiguration );
     }
 
 

Added: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/resources/org/apache/directory/ldapstudio/apacheds/configuration/default-server.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/resources/org/apache/directory/ldapstudio/apacheds/configuration/default-server.xml?view=auto&rev=530010
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/resources/org/apache/directory/ldapstudio/apacheds/configuration/default-server.xml
(added)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/resources/org/apache/directory/ldapstudio/apacheds/configuration/default-server.xml
Wed Apr 18 06:17:37 2007
@@ -0,0 +1,368 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
+  "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+  <bean id="environment" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+    <property name="properties">
+      <props>
+        <prop key="java.naming.security.authentication">simple</prop>
+        <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
+        <prop key="java.naming.security.credentials">secret</prop>
+        <!--<prop key="kdc.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
+        <!--<prop key="kdc.java.naming.security.credentials">secret</prop>-->
+        <!--<prop key="changepw.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
+        <!--<prop key="changepw.java.naming.security.credentials">secret</prop>-->
+        <!-- Set this key to a space delimited set of attributeType descriptions
+             and their OID's if you want an attributeType to be handled as 
+             binary content.
+ 
+             The server will use the schema to derive the set of attributeTypes
+             to treat as binary.  The union if the values you provide here 
+             will be taken as the set of binaries. Note to be consistent you 
+             must add both the OID and all the names an attributeType can have.
+        -->
+        <!-- 
+        <prop key="java.naming.ldap.attributes.binary"></prop>
+        -->
+      </props>
+    </property>
+  </bean>
+  
+  <bean id="configuration" class="org.apache.directory.server.configuration.MutableServerStartupConfiguration">
+    <property name="workingDirectory" value="example.com" />
+
+    <!-- Uncomment below to have the server load entries on startup!        -->
+    <!-- ldifDirectory property can point to a relative file, directory or  -->
+    <!-- can point to an absolute path to either using the URL path         -->
+    <!-- notation: i.e. file:///Users/jack/apacheds/ldifs                   -->
+
+    <!-- Entries will optionally be filtered using LdifLoadFilters in the   -->
+    <!-- order specified.  The included Krb5KdcEntryFilter will filter      -->
+    <!-- kerberos principals creating keys for them using their             -->
+    <!-- userPassword attribute if present.                                 -->
+
+    <!--<property name="ldifDirectory">
+      <value>example.ldif</value>
+    </property>
+    <property name="ldifFilters">
+      <list>
+        <bean class="org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter"/>
+      </list>
+    </property>-->
+
+    <!-- the number of milliseconds before issuing a synch (flush to disk)  -->
+    <!-- which writes out dirty pages back to disk.  To turn off synchs all -->
+    <!-- together simply set this value to <= 0.  Make sure you turn on     -->
+    <!-- synchOnWrite for all partitions if you do choose to do this or else-->
+    <!-- writes may never persist to disk.                                  -->
+    <property name="synchPeriodMillis" value="15000" />
+
+    <!-- limits searches by non-admin users to a max time of 15000          -->
+    <!-- milliseconds and has a default value of 10000                      -->
+    <property name="maxTimeLimit" value="15000" />
+    <!-- limits searches to max size of 1000 entries: default value is 100  -->
+    <property name="maxSizeLimit" value="1000" />
+    <!-- maximum number of threads used by mina is set to 8: default is 4   -->
+    <property name="maxThreads" value="8" />
+
+    <property name="allowAnonymousAccess" value="false" />
+    <property name="accessControlEnabled" value="false" />
+    <property name="enableNtp" value="false" />
+    <property name="enableKerberos" value="false" />
+    <property name="enableChangePassword" value="false" />
+
+    <!--
+       It's more efficient to keep this feature turned off but you may not like
+       having the creatorsName and modifiersName contain OIDs instead of short
+       attributeType names instead.  So if you want the creatorsName to change
+       from the normalized form which is the internal representation of 
+           
+            '0.9.2342.19200300.100.1.1=admin,2.5.4.11=system'
+       
+       to a more human readabile form like:
+
+            'uid=admin,ou=system'
+
+       then set this property to true.
+    -->
+    <property name="denormalizeOpAttrsEnabled" value="false" />
+
+    <property name="ldapPort" value="10389" />
+
+    <property name="systemPartitionConfiguration" ref="systemPartitionConfiguration" />
+
+    <property name="partitionConfigurations">
+      <set>
+        <ref bean="examplePartitionConfiguration"/>
+      </set>
+    </property>
+    
+    <property name="extendedOperationHandlers">
+      <list>
+        <bean class="org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler"/>
+        <bean class="org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler"/>
+      </list>
+    </property>
+
+    <property name="interceptorConfigurations">
+      <list>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="normalizationService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.normalization.NormalizationService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="authenticationService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.authn.AuthenticationService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="referralService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.referral.ReferralService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="authorizationService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.authz.AuthorizationService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="defaultAuthorizationService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.authz.DefaultAuthorizationService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="exceptionService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.exception.ExceptionService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="operationalAttributeService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.operational.OperationalAttributeService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="schemaService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.schema.SchemaService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="subentryService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.subtree.SubentryService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="collectiveAttributeService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.collective.CollectiveAttributeService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="eventService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.event.EventService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="triggerService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.trigger.TriggerService" />
+          </property>
+        </bean>
+
+        <!-- Uncomment to enable replication service
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="replicationService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.mitosis.service.ReplicationService">
+              <property name="configuration">
+                <bean class="org.apache.directory.mitosis.configuration.ReplicationConfiguration">
+                  <property name="replicaId" value="instance_a" />
+                  <property name="serverPort" value="10390" />
+                  <property name="peerReplicas" value="instance_b@localhost:10392" />
+                </bean>
+              </property>
+            </bean>
+          </property>
+        </bean>
+        -->
+      </list>
+    </property>
+  </bean>
+  
+  <!-- use the following partitionConfiguration to override defaults for  -->
+  <!-- the system partition                                               --> 
+  <bean id="systemPartitionConfiguration" class="org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration">
+    <property name="name" value="system" />
+    <property name="cacheSize" value="100" />
+    <property name="suffix" value="ou=system" />
+
+    <!-- the optimizer is enabled by default but may not always be what     -->
+    <!-- you want if your queries are really simple                         -->
+    <property name="optimizerEnabled" value="true" />
+
+    <!--
+      Synchronization on writes does not wait for synch operations
+      to flush dirty pages.  Writes persist immediately to disk at 
+      a cost to performance with increased data integrity.  Otherwise
+      the periodic synch operation will flush dirty pages using the
+      synchPeriodMillis parameter in the main configuration.
+    -->
+    <property name="synchOnWrite" value="true" />
+    <property name="indexedAttributes">
+      <set>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.1" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.2" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.3" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.4" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.5" />
+          <property name="cacheSize" value="10" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.6" />
+          <property name="cacheSize" value="10" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.7" />
+          <property name="cacheSize" value="10" />
+        </bean>
+
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="ou" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="uid" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="objectClass" />
+          <property name="cacheSize" value="100" />
+        </bean>
+      </set>
+    </property>
+    <property name="contextEntry">
+      <value>
+        objectClass: top
+        objectClass: organizationalUnit
+        objectClass: extensibleObject
+        ou: system
+      </value>
+    </property>
+  </bean>
+
+
+  <bean id="examplePartitionConfiguration" class="org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration">
+    <property name="name" value="example" />
+    <property name="cacheSize" value="100" />
+    <property name="suffix" value="dc=example,dc=com" />
+
+    <!-- the optimizer is enabled by default but may not always be what     -->
+    <!-- you want if your queries are really simple                         -->
+    <property name="optimizerEnabled" value="true" />
+
+    <!--
+      Synchronization on writes does not wait for synch operations
+      to flush dirty pages.  Writes persist immediately to disk at 
+      a cost to performance with increased data integrity.  Otherwise
+      the periodic synch operation will flush dirty pages using the
+      synchPeriodMillis parameter in the main configuration.
+    -->
+    <property name="synchOnWrite" value="true" />
+    <property name="indexedAttributes">
+      <set>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.1" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.2" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.3" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.4" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.5" />
+          <property name="cacheSize" value="10" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.6" />
+          <property name="cacheSize" value="10" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.7" />
+          <property name="cacheSize" value="10" />
+        </bean>
+
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="dc" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="ou" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="krb5PrincipalName" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="uid" />
+          <property name="cacheSize" value="100" />
+        </bean>
+        <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
+          <property name="attributeId" value="objectClass" />
+          <property name="cacheSize" value="100" />
+        </bean>
+      </set>
+    </property>
+    <property name="contextEntry">
+      <value>
+        objectClass: top
+        objectClass: domain
+        objectClass: extensibleObject
+        dc: example
+      </value>
+    </property>
+  </bean>
+
+  <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+    <property name="customEditors">
+      <map>
+        <entry key="javax.naming.directory.Attributes">
+          <bean class="org.apache.directory.server.core.configuration.AttributesPropertyEditor"/>
+        </entry>
+      </map>
+   </property>
+  </bean>
+</beans>



Mime
View raw message