directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r985776 - in /directory: apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/ apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/ apached...
Date Sun, 15 Aug 2010 23:27:06 GMT
Author: elecharny
Date: Sun Aug 15 23:27:05 2010
New Revision: 985776

URL: http://svn.apache.org/viewvc?rev=985776&view=rev
Log:
o Merged all the AddRequestXXX methods

Removed:
    directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/message/AddRequest.java
Modified:
    directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
    directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
    directory/apacheds/branches/apacheds-codec-merge/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java
    directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
    directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
    directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=985776&r1=985775&r2=985776&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Sun Aug 15 23:27:05 2010
@@ -28,7 +28,6 @@ import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.AddRequest;
 import org.apache.directory.ldap.client.api.message.CompareRequest;
 import org.apache.directory.ldap.client.api.message.ExtendedRequest;
 import org.apache.directory.ldap.client.api.message.ModifyDnRequest;
@@ -184,19 +183,18 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    public AddResponse add( AddRequest addRequest ) throws LdapException
+    public AddResponse add( InternalAddRequest addRequest ) throws LdapException
     {
         int newId = messageId.incrementAndGet();
 
-        InternalAddRequest iadd = new AddRequestImpl( newId );
-        iadd.setEntry( addRequest.getEntry() );
+        addRequest.setMessageId( newId );
 
         AddResponse resp = new AddResponseImpl( newId );
         resp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
 
         try
         {
-            session.add( iadd );
+            session.add( addRequest );
         }
         catch ( LdapException e )
         {
@@ -206,7 +204,7 @@ public class LdapCoreSessionConnection i
             resp.getLdapResult().setErrorMessage( e.getMessage() );
         }
 
-        addResponseControls( iadd, resp );
+        addResponseControls( addRequest, resp );
         return resp;
     }
 
@@ -216,7 +214,10 @@ public class LdapCoreSessionConnection i
      */
     public AddResponse add( Entry entry ) throws LdapException
     {
-        return add( new AddRequest( entry ) );
+        InternalAddRequest addRequest = new AddRequestImpl();
+        addRequest.setEntry( entry );
+
+        return add( addRequest );
     }
 
 

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java?rev=985776&r1=985775&r2=985776&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
(original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
Sun Aug 15 23:27:05 2010
@@ -32,7 +32,6 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.AddRequest;
 import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -53,9 +52,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.message.internal.AddResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.message.internal.Response;
 import org.apache.directory.shared.ldap.name.DN;
@@ -125,10 +126,11 @@ public class PasswordPolicyTest extends 
         Entry userEntry = LdifUtils.createEntry( userDn, "ObjectClass: top", "ObjectClass:
person", "cn: user",
             "sn: user_sn", "userPassword: 1234" );
 
-        AddRequest addReq = new AddRequest( userEntry );
-        addReq.add( PP_REQ_CTRL );
+        InternalAddRequest addRequest = new AddRequestImpl();
+        addRequest.setEntry( userEntry );
+        addRequest.addControl( PP_REQ_CTRL );
 
-        AddResponse addResp = connection.add( addReq );
+        AddResponse addResp = connection.add( addRequest );
         assertEquals( ResultCodeEnum.CONSTRAINT_VIOLATION, addResp.getLdapResult().getResultCode()
);
 
         PasswordPolicyResponseControl respCtrl = getPwdRespCtrl( addResp );
@@ -139,7 +141,7 @@ public class PasswordPolicyTest extends 
         pwdAt.clear();
         pwdAt.add( "12345" );
 
-        addResp = connection.add( addReq );
+        addResp = connection.add( addRequest );
         assertEquals( ResultCodeEnum.SUCCESS, addResp.getLdapResult().getResultCode() );
         respCtrl = getPwdRespCtrl( addResp );
         assertNull( respCtrl );
@@ -167,10 +169,11 @@ public class PasswordPolicyTest extends 
         userEntry.add( SchemaConstants.SN_AT, "hashedpwd_sn" );
         userEntry.add( SchemaConstants.USER_PASSWORD_AT, password );
 
-        AddRequest addReq = new AddRequest( userEntry );
-        addReq.add( PP_REQ_CTRL );
+        InternalAddRequest addRequest = new AddRequestImpl();
+        addRequest.setEntry( userEntry );
+        addRequest.addControl( PP_REQ_CTRL );
 
-        AddResponse addResp = connection.add( addReq );
+        AddResponse addResp = connection.add( addRequest );
         assertEquals( ResultCodeEnum.CONSTRAINT_VIOLATION, addResp.getLdapResult().getResultCode()
);
 
         PasswordPolicyResponseControl respCtrl = getPwdRespCtrl( addResp );
@@ -182,7 +185,7 @@ public class PasswordPolicyTest extends 
         pwdAt.clear();
         pwdAt.add( password );
 
-        addResp = connection.add( addReq );
+        addResp = connection.add( addRequest );
         assertEquals( ResultCodeEnum.SUCCESS, addResp.getLdapResult().getResultCode() );
         respCtrl = getPwdRespCtrl( addResp );
         assertNull( respCtrl );
@@ -205,10 +208,11 @@ public class PasswordPolicyTest extends 
         Entry userEntry = LdifUtils.createEntry( userDn, "ObjectClass: top", "ObjectClass:
person", "cn: userMinAge",
             "sn: userMinAge_sn", "userPassword: 12345" );
 
-        AddRequest addReq = new AddRequest( userEntry );
-        addReq.add( PP_REQ_CTRL );
+        InternalAddRequest addRequest = new AddRequestImpl();
+        addRequest.setEntry( userEntry );
+        addRequest.addControl( PP_REQ_CTRL );
 
-        AddResponse addResp = connection.add( addReq );
+        AddResponse addResp = connection.add( addRequest );
         assertEquals( ResultCodeEnum.SUCCESS, addResp.getLdapResult().getResultCode() );
 
         PasswordPolicyResponseControl respCtrl = getPwdRespCtrl( addResp );

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java?rev=985776&r1=985775&r2=985776&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
(original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
Sun Aug 15 23:27:05 2010
@@ -33,7 +33,6 @@ import java.util.concurrent.TimeoutExcep
 import org.apache.directory.ldap.client.api.LdapAsyncConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.AddFuture;
-import org.apache.directory.ldap.client.api.message.AddRequest;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -44,9 +43,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.csn.CsnFactory;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.internal.AddResponse;
 import org.apache.directory.shared.ldap.message.internal.BindResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.DateUtils;
@@ -131,8 +132,10 @@ public class ClientAddRequestTest extend
         entry.add( SchemaConstants.SN_AT, "testAsyncAdd_sn" );
 
         assertFalse( session.exists( dn ) );
+        InternalAddRequest addRequest = new AddRequestImpl();
+        addRequest.setEntry( entry );
 
-        AddFuture addFuture = connection.addAsync( new AddRequest( entry ) );
+        AddFuture addFuture = connection.addAsync( addRequest );
 
         try
         {

Modified: directory/apacheds/branches/apacheds-codec-merge/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java?rev=985776&r1=985775&r2=985776&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java
(original)
+++ directory/apacheds/branches/apacheds-codec-merge/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java
Sun Aug 15 23:27:05 2010
@@ -42,7 +42,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -54,6 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.ldif.ChangeType;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.apache.directory.shared.ldap.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.message.DeleteRequestImpl;
 import org.apache.directory.shared.ldap.message.LdapProtocolEncoder;
@@ -61,6 +61,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.UnbindRequestImpl;
 import org.apache.directory.shared.ldap.message.internal.BindResponse;
 import org.apache.directory.shared.ldap.message.internal.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
@@ -223,7 +224,7 @@ public class ImportCommand extends ToolC
     private int addEntry( LdifEntry ldifEntry, int messageId ) throws IOException, DecoderException,
LdapException,
         EncoderException
     {
-        AddRequestCodec addRequest = new AddRequestCodec();
+        InternalAddRequest addRequest = new AddRequestImpl();
 
         String dn = ldifEntry.getDn().getName();
 
@@ -250,7 +251,8 @@ public class ImportCommand extends ToolC
         addRequest.setMessageId( messageId );
 
         // Encode and send the addRequest message
-        ByteBuffer bb = addRequest.encode();
+        LdapProtocolEncoder encoder = new LdapProtocolEncoder();
+        ByteBuffer bb = encoder.encodeMessage( addRequest );
         bb.flip();
 
         sendMessage( bb );

Modified: directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java?rev=985776&r1=985775&r2=985776&view=diff
==============================================================================
--- directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
(original)
+++ directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
Sun Aug 15 23:27:05 2010
@@ -11,7 +11,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.future.ModifyDnFuture;
 import org.apache.directory.ldap.client.api.future.ModifyFuture;
 import org.apache.directory.ldap.client.api.future.SearchFuture;
-import org.apache.directory.ldap.client.api.message.AddRequest;
 import org.apache.directory.ldap.client.api.message.CompareRequest;
 import org.apache.directory.ldap.client.api.message.ExtendedRequest;
 import org.apache.directory.ldap.client.api.message.ModifyDnRequest;
@@ -20,6 +19,7 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.name.DN;
@@ -45,7 +45,7 @@ public interface LdapAsyncConnection ext
      * @return the add operation's response
      * @throws LdapException
      */
-    AddFuture addAsync( AddRequest addRequest ) throws LdapException;
+    AddFuture addAsync( InternalAddRequest addRequest ) throws LdapException;
 
 
     /**

Modified: directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java?rev=985776&r1=985775&r2=985776&view=diff
==============================================================================
--- directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
(original)
+++ directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
Sun Aug 15 23:27:05 2010
@@ -4,7 +4,6 @@ package org.apache.directory.ldap.client
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.directory.ldap.client.api.message.AddRequest;
 import org.apache.directory.ldap.client.api.message.CompareRequest;
 import org.apache.directory.ldap.client.api.message.ExtendedRequest;
 import org.apache.directory.ldap.client.api.message.ModifyDnRequest;
@@ -24,6 +23,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.DeleteResponse;
 import org.apache.directory.shared.ldap.message.internal.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
@@ -93,7 +93,7 @@ public interface LdapConnection
      * @return the add operation's response
      * @throws LdapException
      */
-    public abstract AddResponse add( AddRequest addRequest ) throws LdapException;
+    public abstract AddResponse add( InternalAddRequest addRequest ) throws LdapException;
 
 
     /**

Modified: directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=985776&r1=985775&r2=985776&view=diff
==============================================================================
--- directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Sun Aug 15 23:27:05 2010
@@ -51,7 +51,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.future.ResponseFuture;
 import org.apache.directory.ldap.client.api.future.SearchFuture;
 import org.apache.directory.ldap.client.api.listener.DeleteListener;
-import org.apache.directory.ldap.client.api.message.AddRequest;
 import org.apache.directory.ldap.client.api.message.CompareRequest;
 import org.apache.directory.ldap.client.api.message.ExtendedRequest;
 import org.apache.directory.ldap.client.api.message.ModifyDnRequest;
@@ -65,7 +64,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapTransformer;
 import org.apache.directory.shared.ldap.codec.MessageEncoderException;
-import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.codec.compare.CompareRequestCodec;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
 import org.apache.directory.shared.ldap.codec.extended.ExtendedRequestCodec;
@@ -87,6 +85,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AbandonRequestImpl;
+import org.apache.directory.shared.ldap.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.message.DeleteRequestImpl;
@@ -100,6 +99,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.DeleteResponse;
 import org.apache.directory.shared.ldap.message.internal.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalIntermediateResponse;
@@ -599,7 +599,10 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
-        return add( new AddRequest( entry ) );
+        InternalAddRequest addRequest = new AddRequestImpl();
+        addRequest.setEntry( entry );
+
+        return add( addRequest );
     }
 
 
@@ -615,14 +618,17 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
-        return addAsync( new AddRequest( entry ) );
+        InternalAddRequest addRequest = new AddRequestImpl();
+        addRequest.setEntry( entry );
+
+        return addAsync( addRequest );
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public AddResponse add( AddRequest addRequest ) throws LdapException
+    public AddResponse add( InternalAddRequest addRequest ) throws LdapException
     {
         AddFuture addFuture = addAsync( addRequest );
 
@@ -630,10 +636,8 @@ public class LdapNetworkConnection exten
         try
         {
             // Read the response, waiting for it if not available immediately
-            long timeout = getTimeout( addRequest.getTimeout() );
-
             // Get the response, blocking
-            AddResponse addResponse = addFuture.get( timeout, TimeUnit.MILLISECONDS );
+            AddResponse addResponse = addFuture.get( timeOut, TimeUnit.MILLISECONDS );
 
             if ( addResponse == null )
             {
@@ -688,26 +692,18 @@ public class LdapNetworkConnection exten
     /**
      * {@inheritDoc}
      */
-    public AddFuture addAsync( AddRequest addRequest ) throws LdapException
+    public AddFuture addAsync( InternalAddRequest addRequest ) throws LdapException
     {
         checkSession();
 
-        AddRequestCodec addReqCodec = new AddRequestCodec();
-
         int newId = messageId.incrementAndGet();
 
         addRequest.setMessageId( newId );
-        addReqCodec.setMessageId( newId );
-
-        addReqCodec.setEntry( addRequest.getEntry() );
-        addReqCodec.setEntryDn( addRequest.getEntry().getDn() );
-        setControls( addRequest.getControls(), addReqCodec );
-
         AddFuture addFuture = new AddFuture( this, newId );
         addToFutureMap( newId, addFuture );
 
         // Send the request to the server
-        WriteFuture writeFuture = ldapSession.write( addReqCodec );
+        WriteFuture writeFuture = ldapSession.write( addRequest );
 
         // Wait for the message to be sent to the server
         if ( !writeFuture.awaitUninterruptibly( getTimeout( 0 ) ) )



Mime
View raw message