directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r895160 - in /directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server: annotations/CreateLdapServer.java factory/ServerAnnotationProcessor.java
Date Sat, 02 Jan 2010 09:53:03 GMT
Author: kayyagari
Date: Sat Jan  2 09:53:03 2010
New Revision: 895160

URL: http://svn.apache.org/viewvc?rev=895160&view=rev
Log:
implemented support for adding extended operation handlers to the LdapServer

Modified:
    directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateLdapServer.java
    directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java

Modified: directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateLdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateLdapServer.java?rev=895160&r1=895159&r2=895160&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateLdapServer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateLdapServer.java
Sat Jan  2 09:53:03 2010
@@ -71,4 +71,7 @@
     
     /** The certificate password in base64, default to the empty string */
     String certificatePassword() default "";
+    
+    /** name of the classes implementing extended operations */
+    Class<?>[] extendedOpHandlers() default {};  
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java?rev=895160&r1=895159&r2=895160&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
Sat Jan  2 09:53:03 2010
@@ -26,6 +26,7 @@
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.kerberos.kdc.KdcServer;
+import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.protocol.shared.transport.TcpTransport;
 import org.apache.directory.server.protocol.shared.transport.Transport;
@@ -107,6 +108,19 @@
             
             // Associate the DS to this LdapServer
             ldapServer.setDirectoryService( directoryService );
+
+            for( Class<?> extOpClass : createLdapServer.extendedOpHandlers() )
+            {
+                try
+                {
+                    ExtendedOperationHandler extOpHandler = ( ExtendedOperationHandler )
extOpClass.newInstance();
+                    ldapServer.addExtendedOperationHandler( extOpHandler );
+                }
+                catch( Exception e )
+                {
+                    throw new RuntimeException( "Failed to add the extended operation of
type " + extOpClass.getName(), e );
+                }
+            }
             
             // Launch the server
             try



Mime
View raw message