directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r291232 - /directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ExtendedHandler.java
Date Sat, 24 Sep 2005 01:26:15 GMT
Author: akarasulu
Date: Fri Sep 23 18:26:12 2005
New Revision: 291232

URL: http://svn.apache.org/viewcvs?rev=291232&view=rev
Log:
Applied Stefan Zoerner's patch from DIREVE-256 here 
http://issues.apache.org/jira/browse/DIREVE-256.

Modified:
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ExtendedHandler.java

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ExtendedHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ExtendedHandler.java?rev=291232&r1=291231&r2=291232&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ExtendedHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ExtendedHandler.java
Fri Sep 23 18:26:12 2005
@@ -17,11 +17,15 @@
 package org.apache.ldap.server.protocol;
 
 
-import org.apache.ldap.common.NotImplementedException;
+import org.apache.ldap.common.message.ExtendedRequest;
+import org.apache.ldap.common.message.ExtendedResponse;
+import org.apache.ldap.common.message.ExtendedResponseImpl;
+import org.apache.ldap.common.message.LdapResult;
+import org.apache.ldap.common.message.LdapResultImpl;
+import org.apache.ldap.common.message.ResultCodeEnum;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.handler.MessageHandler;
 
-
 /**
  * A single reply handler for {@link org.apache.ldap.common.message.ExtendedRequest}s.
  *
@@ -32,6 +36,18 @@
 {
     public void messageReceived( ProtocolSession session, Object request )
     {
-        throw new NotImplementedException( "handle in org.apache.ldap.server.protocol.ExtendedHandler
not implemented!" );
+        ExtendedRequest req = ( ExtendedRequest ) request;
+        ExtendedResponse resp = new ExtendedResponseImpl( req.getMessageId() );
+        resp.setLdapResult( new LdapResultImpl( resp ) );
+        
+        // As long as no extended operations are implemented, send appropriate
+        // error back to the client.        
+        String msg = "Unrecognized extended operation";
+        
+        LdapResult result = resp.getLdapResult();        
+        result.setResultCode( ResultCodeEnum.PROTOCOLERROR );
+        result.setErrorMessage( msg );
+        
+        session.write( resp );
     }
 }



Mime
View raw message