directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1565155 - in /directory: apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/ apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ apacheds/trunk/service/ s...
Date Thu, 06 Feb 2014 10:40:44 GMT
Author: kayyagari
Date: Thu Feb  6 10:40:44 2014
New Revision: 1565155

URL: http://svn.apache.org/r1565155
Log:
load stock control and extended operation factories by default

Added:
    directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
Modified:
    directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat
    directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java
    directory/apacheds/trunk/service/apacheds.bat
    directory/apacheds/trunk/service/apacheds.sh
    directory/shared/trunk/ldap/codec/standalone/pom.xml
    directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat?rev=1565155&r1=1565154&r2=1565155&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat
Thu Feb  6 10:40:44 2014
@@ -33,9 +33,9 @@ REM Dynamically build the classpath
 set ADS_CLASSPATH=
 for %%i in (..\lib\*.jar) do call cpappend.bat %%i
 
-set ADS_CONTROLS="-Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory,org.apache.directory.api.ldap.codec.controls.sort.SortRequestFact
 ory,org.apache.directory.api.ldap.codec.controls.sort.SortResponseFactory"
+set ADS_CONTROLS="-Dapacheds.controls="
 
-set ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory"
+set ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations="
 
 REM Launching ApacheDS
 java %ADS_CONTROLS% %ADS_EXTENDED_OPERATIONS% -Dlog4j.configuration="file:../instances/%INSTANCE_NAME%/conf/log4j.properties"
-Dapacheds.log.dir=../instances/%INSTANCE_NAME%/log -cp %ADS_CLASSPATH% org.apache.directory.server.UberjarMain
../instances/%INSTANCE_NAME%

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh?rev=1565155&r1=1565154&r2=1565155&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh
Thu Feb  6 10:40:44 2014
@@ -60,9 +60,9 @@ do
   ADS_CP=${ADS_CP}:$ADS_PWD/lib/${i}
 done
 
-ADS_CONTROLS="-Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory,org.apache.directory.api.ldap.codec.controls.sort.SortRequestFactory,
 org.apache.directory.api.ldap.codec.controls.sort.SortResponseFactory"
+ADS_CONTROLS="-Dapacheds.controls="
 
-ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory"
+ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations="
 
 # Launching ApacheDS
 java $JAVA_OPTS $ADS_CONTROLS $ADS_EXTENDED_OPERATIONS -Dlog4j.configuration=file:$ADS_PWD/instances/$ADS_INSTANCE_NAME/conf/log4j.properties
-Dapacheds.log.dir=$ADS_PWD/instances/$ADS_INSTANCE_NAME/log -cp $ADS_CP org.apache.directory.server.UberjarMain
$ADS_PWD/instances/$ADS_INSTANCE_NAME
\ No newline at end of file

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java?rev=1565155&r1=1565154&r2=1565155&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java
Thu Feb  6 10:40:44 2014
@@ -46,7 +46,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.MockDirectoryService;
 import org.apache.directory.server.core.factory.DSAnnotationProcessor;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.shared.DefaultDnFactory;
 import org.apache.directory.server.factory.ServerAnnotationProcessor;
 import org.apache.directory.server.ldap.LdapServer;
@@ -85,8 +84,6 @@ public class ClientInitialRefreshIT
     @BeforeClass
     public static void setUp() throws Exception
     {
-        Class<?> justLoadToSetControlProperties = Class.forName( FrameworkRunner.class.getName()
);
-
         startProvider();
 
         // Load 1000 entries

Modified: directory/apacheds/trunk/service/apacheds.bat
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/apacheds.bat?rev=1565155&r1=1565154&r2=1565155&view=diff
==============================================================================
--- directory/apacheds/trunk/service/apacheds.bat (original)
+++ directory/apacheds/trunk/service/apacheds.bat Thu Feb  6 10:40:44 2014
@@ -36,9 +36,9 @@ IF NOT exist target/apacheds-service-2.0
    md target/instance/partitions
    md target/instance/log
   
-set ADS_CONTROLS="-Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory,org.apache.directory.api.ldap.codec.controls.sort.SortRequestFact
 ory,org.apache.directory.api.ldap.codec.controls.sort.SortResponseFactory"
+set ADS_CONTROLS="-Dapacheds.controls="
 
-set ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory"
+set ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations="
 
 java %ADS_CONTROLS% %ADS_EXTENDED_OPERATIONS% -Dlog4j.configuration="file:///%cd%/target/instance/conf/log4j.properties"
-jar target/apacheds-service-2.0.0-M11.jar %cd%/target/instance
    

Modified: directory/apacheds/trunk/service/apacheds.sh
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/apacheds.sh?rev=1565155&r1=1565154&r2=1565155&view=diff
==============================================================================
--- directory/apacheds/trunk/service/apacheds.sh (original)
+++ directory/apacheds/trunk/service/apacheds.sh Thu Feb  6 10:40:44 2014
@@ -40,8 +40,8 @@ if [ "$1" = -debug ] ; then
   JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8008 -Xnoagent
-Djava.compiler=NONE"
 fi
 
-ADS_CONTROLS="-Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory,org.apache.directory.api.ldap.codec.controls.sort.SortRequestFactory,
 org.apache.directory.api.ldap.codec.controls.sort.SortResponseFactory"
+ADS_CONTROLS="-Dapacheds.controls="
 
-ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory"
+ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations="
 
 java $JAVA_OPTS $ADS_CONTROLS $ADS_EXTENDED_OPERATIONS -Dlog4j.configuration=file:./target/instance/conf/log4j.properties
-Dapacheds.log.dir=./target/instance/log -jar $JAR ./target/instance

Modified: directory/shared/trunk/ldap/codec/standalone/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/standalone/pom.xml?rev=1565155&r1=1565154&r2=1565155&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/standalone/pom.xml (original)
+++ directory/shared/trunk/ldap/codec/standalone/pom.xml Thu Feb  6 10:40:44 2014
@@ -59,6 +59,11 @@
     </dependency>
 
     <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>api-ldap-extras-codec</artifactId>
+    </dependency> 
+
+    <dependency>
       <groupId>org.apache.mina</groupId>
       <artifactId>mina-core</artifactId>
     </dependency>

Added: directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java?rev=1565155&view=auto
==============================================================================
--- directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
(added)
+++ directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
Thu Feb  6 10:40:44 2014
@@ -0,0 +1,143 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with apiService work for additional information
+ *   regarding copyright ownership.  The ASF licenses apiService file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use apiService 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.api.ldap.codec.standalone;
+
+import java.util.Map;
+
+import org.apache.directory.api.ldap.codec.api.ControlFactory;
+import org.apache.directory.api.ldap.codec.api.ExtendedOperationFactory;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory;
+import org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory;
+import org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory;
+import org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory;
+import org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory;
+import org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory;
+import org.apache.directory.api.ldap.codec.controls.sort.SortRequestFactory;
+import org.apache.directory.api.ldap.codec.controls.sort.SortResponseFactory;
+import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory;
+import org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory;
+import org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory;
+import org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory;
+import org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory;
+import org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory;
+import org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory;
+import org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory;
+import org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory;
+import org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory;
+import org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A utility class for adding Codec and extended operation factories.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class CodecFactoryUtil
+{
+    private static final Logger LOG = LoggerFactory.getLogger( CodecFactoryUtil.class );
+    
+    /**
+     * Loads the Controls implement out of the box in the codec.
+     */
+    public static void loadStockControls( Map<String, ControlFactory<?, ?>> controlFactories,
LdapApiService apiService )
+    {
+        ControlFactory<?, ?> factory = new CascadeFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new EntryChangeFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new ManageDsaITFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new PagedResultsFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new PersistentSearchFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new SubentriesFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+        
+        factory = new PasswordPolicyFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+        
+        factory = new SyncDoneValueFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new SyncInfoValueFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new SyncRequestValueFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new SyncStateValueFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new SortRequestFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+
+        factory = new SortResponseFactory( apiService );
+        controlFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+    }
+    
+    
+    public static void loadStockExtendedOperations( Map<String, ExtendedOperationFactory<?,
?>> extendendOperationsFactories, LdapApiService apiService )
+    {
+        ExtendedOperationFactory<?, ?> factory = new CancelFactory( apiService );
+        extendendOperationsFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled extended operation factory: {}", factory.getOid()
);
+        
+        factory = new CertGenerationFactory( apiService );
+        extendendOperationsFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled extended operation factory: {}", factory.getOid()
);
+        
+        factory = new GracefulShutdownFactory( apiService );
+        extendendOperationsFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled extended operation factory: {}", factory.getOid()
);
+        
+        factory = new StoredProcedureFactory( apiService );
+        extendendOperationsFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled extended operation factory: {}", factory.getOid()
);
+        
+        factory = new GracefulDisconnectFactory( apiService );
+        extendendOperationsFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled extended operation factory: {}", factory.getOid()
);
+        
+        factory = new PasswordModifyFactory( apiService );
+        extendendOperationsFactories.put( factory.getOid(), factory );
+        LOG.info( "Registered pre-bundled extended operation factory: {}", factory.getOid()
);
+    }
+}

Modified: directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java?rev=1565155&r1=1565154&r2=1565155&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java
(original)
+++ directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java
Thu Feb  6 10:40:44 2014
@@ -29,19 +29,17 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-
 import javax.naming.NamingException;
 import javax.naming.ldap.BasicControl;
 
-
 import org.apache.directory.api.asn1.DecoderException;
 import org.apache.directory.api.asn1.EncoderException;
 import org.apache.directory.api.asn1.ber.Asn1Container;
 import org.apache.directory.api.ldap.codec.BasicControlDecorator;
 import org.apache.directory.api.ldap.codec.api.CodecControl;
 import org.apache.directory.api.ldap.codec.api.ControlFactory;
-import org.apache.directory.api.ldap.codec.api.ExtendedRequestDecorator;
 import org.apache.directory.api.ldap.codec.api.ExtendedOperationFactory;
+import org.apache.directory.api.ldap.codec.api.ExtendedRequestDecorator;
 import org.apache.directory.api.ldap.codec.api.ExtendedResponseDecorator;
 import org.apache.directory.api.ldap.codec.api.LdapApiService;
 import org.apache.directory.api.ldap.codec.api.LdapMessageContainer;
@@ -174,6 +172,10 @@ public class StandaloneLdapApiService im
 
     public StandaloneLdapApiService( List<String> controls, List<String> extendedOperations
) throws Exception
     {
+        CodecFactoryUtil.loadStockControls( controlFactories, this );
+        
+        CodecFactoryUtil.loadStockExtendedOperations( extendendOperationsFactories, this
);
+        
         // Load the controls
         loadControls( controls );
             
@@ -334,6 +336,12 @@ public class StandaloneLdapApiService im
      */
     private void loadControl( String control ) throws Exception
     {
+        if ( controlFactories.containsKey( control ) )
+        {
+            LOG.debug( "Factory for control {} was already loaded", control );
+            return;
+        }
+        
         Class<?>[] types = new Class<?>[]
             { LdapApiService.class };
         // note, trimming whitespace doesnt hurt as it is a class name and
@@ -365,6 +373,12 @@ public class StandaloneLdapApiService im
 
     private void loadExtendedOperation( String extendedOperation ) throws Exception
     {
+        if ( extendendOperationsFactories.containsKey( extendedOperation ) )
+        {
+            LOG.debug( "Factory for extended operation {} was already loaded", extendedOperation
);
+            return;
+        }
+        
         Class<?>[] types = new Class<?>[]
             { LdapApiService.class };
         // note, trimming whitespace doesnt hurt as it is a class name and



Mime
View raw message