directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r948003 - in /directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config: ConfigPartitionReader.java ConfigSchemaConstants.java
Date Tue, 25 May 2010 11:21:53 GMT
Author: kayyagari
Date: Tue May 25 11:21:52 2010
New Revision: 948003

URL: http://svn.apache.org/viewvc?rev=948003&view=rev
Log:
o added support for adding extended operation handlers
o fixed an issue with processing a disabled entry's config

Modified:
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=948003&r1=948002&r2=948003&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
(original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
Tue May 25 11:21:52 2010
@@ -59,6 +59,7 @@ import org.apache.directory.server.integ
 import org.apache.directory.server.integration.http.WebApp;
 import org.apache.directory.server.kerberos.kdc.KdcServer;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
+import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.ldap.handlers.bind.MechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
@@ -220,6 +221,7 @@ public class ConfigPartitionReader
             server.setSearchBaseDn( searchBaseAttr.getString() );
         }
         
+        // read the SASL mechanism handlers' configuration
         filter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT, new StringValue(
             ConfigSchemaConstants.ADS_LDAP_SERVER_SASL_MECH_HANDLER_OC ) );
         cursor = se.cursor( ldapServerEntry.getDn(), AliasDerefMode.NEVER_DEREF_ALIASES,
filter, controls );
@@ -237,6 +239,28 @@ public class ConfigPartitionReader
         
         cursor.close();
         
+        // read the extnded operation handlers' config
+        filter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT, new StringValue(
+            ConfigSchemaConstants.ADS_LDAP_SERVER_EXT_OP_HANDLER_OC ) );
+        cursor = se.cursor( ldapServerEntry.getDn(), AliasDerefMode.NEVER_DEREF_ALIASES,
filter, controls );
+        
+        while( cursor.next() )
+        {
+            ForwardIndexEntry<Long, Entry, Long> forwardExtOpEntry = ( ForwardIndexEntry<Long,
Entry, Long> ) cursor.get();
+            Entry extOpHandlerEntry = configPartition.lookup( forwardExtOpEntry.getId() );
+            
+            if( !isEnabled( extOpHandlerEntry ) )
+            {
+                continue;
+            }
+            
+            Class<?> extendedOpClass = Class.forName( extOpHandlerEntry.get( ConfigSchemaConstants.ADS_LDAP_SERVER_EXT_OP_HANDLER_FQCN
).getString() );
+            ExtendedOperationHandler extOpHandler = ( ExtendedOperationHandler ) extendedOpClass.newInstance();
+            server.addExtendedOperationHandler( extOpHandler );
+        }
+        
+        cursor.close();
+        
         return server;
     }
 
@@ -969,6 +993,11 @@ public class ConfigPartitionReader
             ForwardIndexEntry<Long, Entry, Long> forwardEntry = ( ForwardIndexEntry<Long,
Entry, Long> ) cursor
                 .get();
             Entry interceptorEntry = configPartition.lookup( forwardEntry.getId() );
+            
+            if( ! isEnabled( interceptorEntry ) )
+            {
+                continue;
+            }
 
             String id = getString( ConfigSchemaConstants.ADS_INTERCEPTOR_ID, interceptorEntry
);
             String fqcn = getString( ConfigSchemaConstants.ADS_INTERCEPTOR_CLASSNAME, interceptorEntry
);

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java?rev=948003&r1=948002&r2=948003&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
(original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
Tue May 25 11:21:52 2010
@@ -218,4 +218,8 @@ public interface ConfigSchemaConstants
     String ADS_LDAP_SERVER_SASL_MECH_CLASS_NAME = "ads-ldapServerSaslMechClassName";
     
     String ADS_LDAP_SERVER_NTLM_MECH_PROVIDER = "ads-ldapServerNtlmMechProvider";
+    
+    String ADS_LDAP_SERVER_EXT_OP_HANDLER_OC = "ads-ldapServerExtendedOpHandler";
+    
+    String ADS_LDAP_SERVER_EXT_OP_HANDLER_FQCN = "ads-ldapServerExtendedOpHandlerClass";
 }



Mime
View raw message