directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r414617 - in /directory/trunks: apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/ apacheds/server-unit/src/test/java/org/apache/directory/server/ shared/ldap/src/main/java/org/apache/directory/shared/ld...
Date Thu, 15 Jun 2006 15:26:43 GMT
Author: akarasulu
Date: Thu Jun 15 08:26:42 2006
New Revision: 414617

URL: http://svn.apache.org/viewvc?rev=414617&view=rev
Log:
Added functionality to start processing stored procedure requests in the server
and have started to make calls into her.  The problem is we have some 
communincation exceptions being thrown now.  Gotta figure this out.

Modified:
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/JavaStoredProcedureExtendedOperationHandler.java
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LanguageSpecificStoredProceureExtendedOperationHandler.java
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponseImpl.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureResponse.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?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- 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
Thu Jun 15 08:26:42 2006
@@ -14,10 +14,9 @@
  *   limitations under the License.
  *
  */
-
-
 package org.apache.directory.server.ldap.support.extended;
 
+
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
@@ -42,11 +41,6 @@
  */
 public class JavaStoredProcedureExtendedOperationHandler implements LanguageSpecificStoredProceureExtendedOperationHandler
 {
-    public JavaStoredProcedureExtendedOperationHandler()
-    {
-        
-    }
-    
     public void handleStoredProcedureExtendedOperation( ServerLdapContext ctx, StoredProcedure
pojo ) throws ClassNotFoundException, NamingException
     {
         List types = new ArrayList( pojo.getParameters().size() );

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LanguageSpecificStoredProceureExtendedOperationHandler.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LanguageSpecificStoredProceureExtendedOperationHandler.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LanguageSpecificStoredProceureExtendedOperationHandler.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LanguageSpecificStoredProceureExtendedOperationHandler.java
Thu Jun 15 08:26:42 2006
@@ -14,10 +14,9 @@
  *   limitations under the License.
  *
  */
-
-
 package org.apache.directory.server.ldap.support.extended;
 
+
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedure;
 
@@ -29,7 +28,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$ $Date$
  */
-public interface LanguageSpecificStoredProceureExtendedOperationHandler
+public interface LanguageSpecificStoredProceureExtendedOperationHandler 
 {
     void handleStoredProcedureExtendedOperation( ServerLdapContext ctx, StoredProcedure spBean
) throws Exception;
 }

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
Thu Jun 15 08:26:42 2006
@@ -20,6 +20,8 @@
 
 
 import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.Set;
 
 import javax.naming.ldap.Control;
@@ -34,6 +36,8 @@
 import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedureContainer;
 import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedureDecoder;
 import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.extended.StoredProcedureRequest;
+import org.apache.directory.shared.ldap.message.extended.StoredProcedureResponse;
 import org.apache.mina.common.IoSession;
 
 
@@ -43,15 +47,6 @@
  */
 public class StoredProcedureExtendedOperationHandler implements ExtendedOperationHandler
 {
-
-    public String getOid()
-    {
-        /**
-         * TODO return the correct OID. 
-         */
-        return "1.2.3.4.55.666.7777";
-    }
-
     public void handleExtendedOperation( IoSession session, SessionRegistry registry, ExtendedRequest
req ) throws Exception
     {
         Control[] connCtls = ( Control[] ) req.getControls().values().toArray( new Control[
req.getControls().size() ] );
@@ -63,7 +58,7 @@
         /**
          * TODO This part may be replaced by a better handler determiner.
          */
-        if ( spBean.getLanguage().equals( "Java" ) )
+        if ( spBean.getLanguage().equalsIgnoreCase( "Java" ) )
         {
             handler = new JavaStoredProcedureExtendedOperationHandler();
             handler.handleStoredProcedureExtendedOperation( serverLdapContext, spBean );
@@ -90,14 +85,30 @@
         return spBean;
     }
 
-	public Set getExtensionOids() {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    
+    public String getOid()
+    {
+        return StoredProcedureRequest.EXTENSION_OID;
+    }
 
-	public void setLdapProvider(LdapProtocolProvider provider) {
-		// TODO Auto-generated method stub
-		
-	}
 
+    private static final Set EXTENSION_OIDS;
+    static
+    {
+        Set s = new HashSet();
+        s.add( StoredProcedureRequest.EXTENSION_OID );
+        s.add( StoredProcedureResponse.EXTENSION_OID );
+        EXTENSION_OIDS = Collections.unmodifiableSet( s );
+    }
+    
+    
+    public Set getExtensionOids()
+    {
+        return EXTENSION_OIDS;
+    }
+
+    
+	public void setLdapProvider(LdapProtocolProvider provider) 
+    {
+	}
 }

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
(original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
Thu Jun 15 08:26:42 2006
@@ -22,6 +22,7 @@
 import javax.naming.ldap.LdapContext;
 import javax.naming.NamingException;
 
+import org.apache.directory.server.ldap.support.extended.StoredProcedureExtendedOperationHandler;
 import org.apache.directory.server.unit.AbstractServerTest;
 import org.apache.directory.shared.ldap.message.extended.StoredProcedureRequest;
 import org.apache.directory.shared.ldap.message.extended.StoredProcedureResponse;
@@ -29,7 +30,9 @@
 import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.Set;
 
 
 /**
@@ -50,6 +53,10 @@
      */
     public void setUp() throws Exception
     {
+        Set handlers = new HashSet( super.configuration.getExtendedOperationHandlers() );
+        handlers.add( new StoredProcedureExtendedOperationHandler() );
+        super.configuration.setExtendedOperationHandlers( handlers );
+        
         super.setUp();
 
         Hashtable env = new Hashtable();

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponseImpl.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponseImpl.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponseImpl.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponseImpl.java
Thu Jun 15 08:26:42 2006
@@ -47,7 +47,14 @@
      * @param id
      *            the session unique message id
      */
-    public ExtendedResponseImpl(final int id)
+    public ExtendedResponseImpl( final int id, String oid )
+    {
+        super( id, TYPE );
+        this.oid = oid;
+    }
+
+
+    public ExtendedResponseImpl( int id )
     {
         super( id, TYPE );
     }
@@ -77,6 +84,12 @@
     public void setResponse( byte[] value )
     {
         this.value = value;
+    }
+    
+    
+    public void setOid( String oid )
+    {
+        this.oid = oid;
     }
 
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java
Thu Jun 15 08:26:42 2006
@@ -69,7 +69,7 @@
 
     public GracefulDisconnect(byte[] value) throws NamingException
     {
-        super( 0 );
+        super( 0, EXTENSION_OID );
         this.value = value;
         decodeValue();
     }
@@ -77,7 +77,7 @@
 
     public GracefulDisconnect(int timeOffline, int delay)
     {
-        super( 0 );
+        super( 0, EXTENSION_OID );
         super.oid = EXTENSION_OID;
         this.timeOffline = timeOffline;
         this.delay = delay;

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
Thu Jun 15 08:26:42 2006
@@ -40,7 +40,7 @@
 
     public GracefulShutdownResponse(int messageId, ResultCodeEnum rcode)
     {
-        super( messageId );
+        super( messageId, EXTENSION_OID );
 
         switch ( rcode.getValue() )
         {
@@ -61,7 +61,7 @@
 
     public GracefulShutdownResponse(int messageId)
     {
-        super( messageId );
+        super( messageId, EXTENSION_OID );
         super.getLdapResult().setMatchedDn( null );
         super.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
     }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
Thu Jun 15 08:26:42 2006
@@ -39,7 +39,7 @@
 
     public LaunchDiagnosticUiResponse(int messageId, ResultCodeEnum rcode)
     {
-        super( messageId );
+        super( messageId, EXTENSION_OID );
 
         switch ( rcode.getValue() )
         {
@@ -60,7 +60,7 @@
 
     public LaunchDiagnosticUiResponse(int messageId)
     {
-        super( messageId );
+        super( messageId, EXTENSION_OID );
         super.getLdapResult().setMatchedDn( null);
         super.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
     }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
Thu Jun 15 08:26:42 2006
@@ -115,7 +115,7 @@
 
     private NoticeOfDisconnect(ResultCodeEnum rcode)
     {
-        super( 0 );
+        super( 0, EXTENSION_OID );
 
         switch ( rcode.getValue() )
         {

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
Thu Jun 15 08:26:42 2006
@@ -53,6 +53,7 @@
     public StoredProcedureRequest( int messageId, String procedure, String language )
     {
         super( messageId );
+        this.setOid( EXTENSION_OID );
         this.procedure = new StoredProcedure();
         this.procedure.setLanguage( language );
         this.procedure.setProcedure( StringTools.getBytesUtf8( procedure ) );

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureResponse.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureResponse.java?rev=414617&r1=414616&r2=414617&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureResponse.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureResponse.java
Thu Jun 15 08:26:42 2006
@@ -8,9 +8,10 @@
 {
     public StoredProcedureResponse( int messageId )
     {
-        super( messageId );
+        super( messageId, EXTENSION_OID );
     }
 
     private static final long serialVersionUID = 1L;
+    public static final String EXTENSION_OID = "1.2.6.1.4.1.18060.1.1.1.100.7";
 
 }



Mime
View raw message