directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r963140 - /directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Sun, 11 Jul 2010 20:01:37 GMT
Author: kayyagari
Date: Sun Jul 11 20:01:37 2010
New Revision: 963140

URL: http://svn.apache.org/viewvc?rev=963140&view=rev
Log:
o fixed the messageReceived() and convert(XXResponse) methods where received controls are
not properly added to the response to be returned

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

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=963140&r1=963139&r2=963140&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Sun Jul 11 20:01:37 2010
@@ -365,6 +365,7 @@ public class LdapNetworkConnection exten
         bindResponse.setMessageId( bindResponseCodec.getMessageId() );
         bindResponse.setServerSaslCreds( bindResponseCodec.getServerSaslCreds() );
         bindResponse.setLdapResult( convert( bindResponseCodec.getLdapResult() ) );
+        addControls( bindResponseCodec, bindResponse );
 
         return bindResponse;
     }
@@ -380,10 +381,12 @@ public class LdapNetworkConnection exten
         if( responseFuture instanceof SearchFuture )
         {
             intermediateResponse = new SearchIntermediateResponse();
+            addControls( intermediateResponseCodec, ( SearchIntermediateResponse ) intermediateResponse
);
         }
         else if( responseFuture instanceof ExtendedFuture )
         {
             intermediateResponse = new ExtendedIntermediateResponse();
+            addControls( intermediateResponseCodec, ( ExtendedIntermediateResponse ) intermediateResponse
);
         }
         else
         {
@@ -864,6 +867,7 @@ public class LdapNetworkConnection exten
 
         addResponse.setMessageId( addRespCodec.getMessageId() );
         addResponse.setLdapResult( convert( addRespCodec.getLdapResult() ) );
+        addControls( addRespCodec, addResponse );
 
         return addResponse;
     }
@@ -1501,7 +1505,7 @@ public class LdapNetworkConnection exten
             case ADD_RESPONSE:
                 // Transform the response
                 AddResponseCodec addRespCodec = (AddResponseCodec)response;
-                addRespCodec.addControl( response.getCurrentControl() );
+                addRespCodec.addControls( response.getControls() );
                 addRespCodec.setMessageId( messageId );
 
                 AddResponse addResponse = convert( addRespCodec );
@@ -1541,7 +1545,7 @@ public class LdapNetworkConnection exten
                 // Transform the response
                 BindResponseCodec bindResponseCodec = (BindResponseCodec)response;
                 bindResponseCodec.setMessageId( messageId );
-                bindResponseCodec.addControl( response.getCurrentControl() );
+                bindResponseCodec.addControls( response.getControls() );
                 BindResponse bindResponse = convert( bindResponseCodec );
 
                 BindFuture bindFuture = (BindFuture)responseFuture;
@@ -1578,7 +1582,7 @@ public class LdapNetworkConnection exten
                 // Transform the response
                 CompareResponseCodec compResCodec = (CompareResponseCodec)response;
                 compResCodec.setMessageId( messageId );
-                compResCodec.addControl( response.getCurrentControl() );
+                compResCodec.addControls( response.getControls() );
 
                 CompareResponse compareResponse = convert( compResCodec );
                 
@@ -1616,7 +1620,7 @@ public class LdapNetworkConnection exten
             case DEL_RESPONSE:
                 // Transform the response
                 DelResponseCodec delRespCodec = (DelResponseCodec)response;
-                delRespCodec.addControl( response.getCurrentControl() );
+                delRespCodec.addControls( response.getControls() );
                 delRespCodec.setMessageId( messageId );
 
                 DeleteResponse deleteResponse = convert( delRespCodec );
@@ -1655,7 +1659,7 @@ public class LdapNetworkConnection exten
                 // Transform the response
                 ExtendedResponseCodec extResCodec = (ExtendedResponseCodec)response;
                 extResCodec.setMessageId( messageId );
-                extResCodec.addControl( response.getCurrentControl() );
+                extResCodec.addControls( response.getControls() );
 
                 ExtendedResponse extendedResponse = convert( extResCodec );
 
@@ -1693,7 +1697,7 @@ public class LdapNetworkConnection exten
             case INTERMEDIATE_RESPONSE:
                 IntermediateResponseCodec intermediateResponseCodec = (IntermediateResponseCodec)response;
                 intermediateResponseCodec.setMessageId( messageId );
-                intermediateResponseCodec.addControl( response.getCurrentControl() );
+                intermediateResponseCodec.addControls( response.getControls() );
 
                 setIResponse( intermediateResponseCodec, responseFuture );
                 
@@ -1703,7 +1707,7 @@ public class LdapNetworkConnection exten
                 // Transform the response
                 ModifyResponseCodec modRespCodec = (ModifyResponseCodec)response;
                 modRespCodec.setMessageId( messageId );
-                modRespCodec.addControl( response.getCurrentControl() );
+                modRespCodec.addControls( response.getControls() );
 
                 ModifyResponse modifyResp = convert( modRespCodec );
                 
@@ -1741,7 +1745,7 @@ public class LdapNetworkConnection exten
                 // Transform the response
                 ModifyDNResponseCodec modDnRespCodec = (ModifyDNResponseCodec)response;
                 modDnRespCodec.setMessageId( messageId );
-                modDnRespCodec.addControl( response.getCurrentControl() );
+                modDnRespCodec.addControls( response.getControls() );
 
                 ModifyDnResponse modifyDnResp = convert( modDnRespCodec );
                 
@@ -1779,7 +1783,7 @@ public class LdapNetworkConnection exten
                 // Store the response into the responseQueue
                 SearchResultDoneCodec searchResultDoneCodec = (SearchResultDoneCodec)response;
                 searchResultDoneCodec.setMessageId( messageId );
-                searchResultDoneCodec.addControl( response.getCurrentControl() );
+                searchResultDoneCodec.addControls( response.getControls() );
                 SearchResultDone searchResultDone = convert( searchResultDoneCodec );
 
                 SearchFuture searchFuture = (SearchFuture)responseFuture;
@@ -1816,7 +1820,7 @@ public class LdapNetworkConnection exten
                 // Store the response into the responseQueue
                 SearchResultEntryCodec searchResultEntryCodec = (SearchResultEntryCodec)response;
                 searchResultEntryCodec.setMessageId( messageId );
-                searchResultEntryCodec.addControl( response.getCurrentControl() );
+                searchResultEntryCodec.addControls( response.getControls() );
 
                 SearchResultEntry srchEntry = convert( searchResultEntryCodec );
 
@@ -1842,7 +1846,7 @@ public class LdapNetworkConnection exten
                 // Store the response into the responseQueue
                 SearchResultReferenceCodec searchResultReferenceCodec = (SearchResultReferenceCodec)response;
                 searchResultReferenceCodec.setMessageId( messageId );
-                searchResultReferenceCodec.addControl( response.getCurrentControl() );
+                searchResultReferenceCodec.addControls( response.getControls() );
 
                 SearchResultReference searchResultReference = convert( searchResultReferenceCodec
);
 
@@ -2007,6 +2011,7 @@ public class LdapNetworkConnection exten
 
         modResponse.setMessageId( modRespCodec.getMessageId() );
         modResponse.setLdapResult( convert( modRespCodec.getLdapResult() ) );
+        addControls( modRespCodec, modResponse );
 
         return modResponse;
     }
@@ -2285,6 +2290,7 @@ public class LdapNetworkConnection exten
 
         modDnResponse.setMessageId( modDnRespCodec.getMessageId() );
         modDnResponse.setLdapResult( convert( modDnRespCodec.getLdapResult() ) );
+        addControls( modDnRespCodec, modDnResponse );
 
         return modDnResponse;
     }
@@ -2800,6 +2806,7 @@ public class LdapNetworkConnection exten
 
         compareResponse.setMessageId( compareRespCodec.getMessageId() );
         compareResponse.setLdapResult( convert( compareRespCodec.getLdapResult() ) );
+        addControls( compareRespCodec, compareResponse );
 
         return compareResponse;
     }
@@ -2814,7 +2821,8 @@ public class LdapNetworkConnection exten
 
         response.setMessageId( delRespCodec.getMessageId() );
         response.setLdapResult( convert( delRespCodec.getLdapResult() ) );
-
+        addControls( delRespCodec, response );
+        
         return response;
     }
 
@@ -3037,7 +3045,9 @@ public class LdapNetworkConnection exten
         extResponse.setValue( extRespCodec.getResponse() );
         extResponse.setMessageId( extRespCodec.getMessageId() );
         extResponse.setLdapResult( convert( extRespCodec.getLdapResult() ) );
-
+        
+        addControls( extRespCodec, extResponse );
+        
         return extResponse;
     }
 



Mime
View raw message