directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r440036 - /directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/JavaStoredProcedureExtendedOperationHandler.java
Date Mon, 04 Sep 2006 11:53:07 GMT
Author: ersiner
Date: Mon Sep  4 04:53:06 2006
New Revision: 440036

URL: http://svn.apache.org/viewvc?view=rev&rev=440036
Log:
Added support for special SP parameter: $ldapContext.

Modified:
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/JavaStoredProcedureExtendedOperationHandler.java

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/JavaStoredProcedureExtendedOperationHandler.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/JavaStoredProcedureExtendedOperationHandler.java?view=diff&rev=440036&r1=440035&r2=440036
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/JavaStoredProcedureExtendedOperationHandler.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/JavaStoredProcedureExtendedOperationHandler.java
Mon Sep  4 04:53:06 2006
@@ -27,6 +27,7 @@
 import java.util.List;
 
 import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
 
 import org.apache.commons.lang.SerializationUtils;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
@@ -59,10 +60,20 @@
         {
             StoredProcedureParameter pPojo = ( StoredProcedureParameter ) it.next();
             
+            String typeName;
             Class type;
             try
             {
-                type = SpringClassUtils.forName( StringTools.utf8ToString( pPojo.getType()
) );
+                typeName = StringTools.utf8ToString( pPojo.getType() );
+                if ( typeName.equals( "$ldapContext" ) )
+                {
+                    type = LdapContext.class;
+                }
+                else
+                {
+                    type = SpringClassUtils.forName( typeName );
+                }
+                
             }
             catch ( ClassNotFoundException e )
             {
@@ -77,7 +88,15 @@
             
             try
             {
-                values.add( SerializationUtils.deserialize( serializedValue ) );
+                if ( typeName.equals( "$ldapContext" ) )
+                {
+                    String newCtx = (String) SerializationUtils.deserialize( serializedValue
);
+                    values.add( ctx.lookup( newCtx ) );
+                }
+                else
+                {
+                    values.add( SerializationUtils.deserialize( serializedValue ) );
+                }
             }
             catch ( Exception e )
             {



Mime
View raw message