directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r903684 - in /directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api: LdapConnection.java message/AbstractMessage.java
Date Wed, 27 Jan 2010 15:30:22 GMT
Author: kayyagari
Date: Wed Jan 27 15:30:21 2010
New Revision: 903684

URL: http://svn.apache.org/viewvc?rev=903684&view=rev
Log:
o fixed a ClassCastException while abandoning a search request
o updated the code with changed Control API
o commented adding Controls to SearchResultEntry to prevent test failures at the moment

Modified:
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/message/AbstractMessage.java

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java?rev=903684&r1=903683&r2=903684&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
Wed Jan 27 15:30:21 2010
@@ -61,7 +61,6 @@
 import org.apache.directory.ldap.client.api.message.BindResponse;
 import org.apache.directory.ldap.client.api.message.CompareRequest;
 import org.apache.directory.ldap.client.api.message.CompareResponse;
-import org.apache.directory.ldap.client.api.message.Control;
 import org.apache.directory.ldap.client.api.message.DeleteRequest;
 import org.apache.directory.ldap.client.api.message.DeleteResponse;
 import org.apache.directory.ldap.client.api.message.ExtendedRequest;
@@ -78,6 +77,7 @@
 import org.apache.directory.ldap.client.api.message.SearchResultDone;
 import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.ldap.client.api.message.SearchResultReference;
+import org.apache.directory.ldap.client.api.message.control.Control;
 import org.apache.directory.ldap.client.api.message.control.ControlImpl;
 import org.apache.directory.ldap.client.api.protocol.LdapProtocolCodecFactory;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
@@ -290,7 +290,7 @@
                 ControlCodec ctrl = new ControlCodec();
                 
                 ctrl.setControlType( control.getID() );
-                ctrl.setControlValue( control.getEncodedValue() );
+                ctrl.setControlValue( control.getValue() );
                 
                 message.addControl( ctrl );
             }
@@ -1092,9 +1092,11 @@
 
         // Creates the messageID and stores it into the 
         // initial message and the transmitted message.
-        // As it's a Bind request, qe reset the MessageId 
+        // As it's a Bind request, reset the MessageId 
         // value to zero.
         messageId.set( 0 );
+        
+        // the bind request should always start with message id 1 (One)
         int newId = messageId.incrementAndGet();
         bindRequest.setMessageId( newId );
         bindMessage.setMessageId( newId );
@@ -1422,7 +1424,7 @@
                 // Send an abandon request
                 if( !searchFuture.isCancelled() )
                 {
-                    abandon( searchMessage.getBindRequest().getMessageId() );
+                    abandon( searchMessage.getSearchRequest().getMessageId() );
                 }
                 
                 throw ldapException;
@@ -2840,8 +2842,9 @@
         {
             for( ControlCodec cc : ccList )
             {
-                Control control = new ControlImpl( cc.getControlType(), cc.getCriticality(),
cc.getEncodedValue() );
-                message.add( control );
+                // FIXME this is causing the exceptions
+                //Control control = new ControlImpl( cc.getControlType(), cc.getEncodedValue(),
cc.getCriticality() );
+                //message.add( control );
             }
         }
     }

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/message/AbstractMessage.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/message/AbstractMessage.java?rev=903684&r1=903683&r2=903684&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/message/AbstractMessage.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/message/AbstractMessage.java
Wed Jan 27 15:30:21 2010
@@ -90,7 +90,7 @@
         {
             for ( Control control:controls )
             {
-                this.controls.put( control.getId(), control );
+                this.controls.put( control.getID(), control );
             }
         }
         
@@ -142,7 +142,7 @@
         {
             for ( Control ctrl:controls )
             {
-                this.controls.remove( ctrl.getId() );
+                this.controls.remove( ctrl.getID() );
             }
         }
         
@@ -169,7 +169,7 @@
             for ( Control control:controls.values() )
             {
                 sb.append( "        " ).append( control.getClass().getSimpleName() );
-                sb.append( ":" ).append( control.getId() ).append( "\n" );
+                sb.append( ":" ).append( control.getID() ).append( "\n" );
             }
         }
 



Mime
View raw message