directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r986083 [1/2] - in /directory: apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/ apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/interceptor/contex...
Date Mon, 16 Aug 2010 18:11:23 GMT
Author: elecharny
Date: Mon Aug 16 18:11:21 2010
New Revision: 986083

URL: http://svn.apache.org/viewvc?rev=986083&view=rev
Log:
Merged the modifyRequest classes

Removed:
    directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/message/ModifyRequest.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/
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-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.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/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
    directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
    directory/apacheds/branches/apacheds-codec-merge/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.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
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapProtocolEncoder.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalModifyRequest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.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=986083&r1=986082&r2=986083&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 Mon Aug 16 18:11:21 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.ModifyRequest;
 import org.apache.directory.ldap.client.api.message.SearchRequest;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -561,26 +560,17 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    public ModifyResponse modify( ModifyRequest modRequest ) throws LdapException
+    public ModifyResponse modify( InternalModifyRequest modRequest ) throws LdapException
     {
         int newId = messageId.incrementAndGet();
 
+        modRequest.setMessageId( newId );
         ModifyResponse resp = new ModifyResponseImpl( newId );
         resp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
 
-        InternalModifyRequest iModReq = new ModifyRequestImpl( newId );
-
         try
         {
-            iModReq.setName( modRequest.getDn() );
-
-            Iterator<Modification> itr = modRequest.getMods().iterator();
-            while ( itr.hasNext() )
-            {
-                iModReq.addModification( itr.next() );
-            }
-
-            session.modify( iModReq );
+            session.modify( modRequest );
         }
         catch ( LdapException e )
         {
@@ -590,7 +580,7 @@ public class LdapCoreSessionConnection i
             resp.getLdapResult().setErrorMessage( e.getMessage() );
         }
 
-        addResponseControls( iModReq, resp );
+        addResponseControls( modRequest, resp );
         return resp;
     }
 

Modified: directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java Mon Aug 16 18:11:21 2010
@@ -81,7 +81,7 @@ public class ModifyOperationContext exte
     {
         super( session, modifyRequest.getName() );
 
-        modItems = ServerEntryUtils.toServerModification( modifyRequest.getModificationItems().toArray(
+        modItems = ServerEntryUtils.toServerModification( modifyRequest.getModifications().toArray(
             new DefaultModification[0] ), session.getDirectoryService().getSchemaManager() );
 
         requestControls = modifyRequest.getControls();

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java Mon Aug 16 18:11:21 2010
@@ -29,15 +29,16 @@ import static org.junit.Assert.assertTru
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.internal.BindResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -202,7 +203,8 @@ public class SimpleAuthenticationIT exte
         assertTrue( entry.get( "roomnumber" ).contains( "4612" ) );
 
         // now modify the password for akarasulu
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "newpwd" );
         connection.modify( modReq );
 
@@ -252,7 +254,8 @@ public class SimpleAuthenticationIT exte
         assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );
 
         // now modify the password for akarasulu : 'secret', encrypted using SHA
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "{SHA}5en6G6MezRroT3XKqkdPOmY/BfQ=" );
         connection.modify( modReq );
 
@@ -293,7 +296,8 @@ public class SimpleAuthenticationIT exte
         assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );
 
         // now modify the password for akarasulu : 'secret', encrypted using SHA
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "{SSHA}mjVVxasFkk59wMW4L1Ldt+YCblfhULHs03WW7g==" );
         connection.modify( modReq );
 
@@ -332,7 +336,8 @@ public class SimpleAuthenticationIT exte
         assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );
 
         // now modify the password for akarasulu : 'test123', encrypted using SHA with a 4 bytes salt
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "{SSHA}0TT388zsWzHKtMEpIU/8/W68egchNEWp" );
         connection.modify( modReq );
 
@@ -371,7 +376,8 @@ public class SimpleAuthenticationIT exte
         assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );
 
         // now modify the password for akarasulu : 'secret', encrypted using MD5
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "{MD5}Xr4ilOzQ4PCOq3aQ0qbuaQ==" );
         connection.modify( modReq );
 
@@ -411,7 +417,8 @@ public class SimpleAuthenticationIT exte
         assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );
 
         // now modify the password for akarasulu : 'secret', encrypted using SMD5
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "{SMD5}tQ9wo/VBuKsqBtylMMCcORbnYOJFMyDJ" );
         connection.modify( modReq );
 
@@ -450,7 +457,8 @@ public class SimpleAuthenticationIT exte
         assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );
 
         // now modify the password for akarasulu : 'secret', encrypted using CRYPT
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "{crypt}qFkH8Z1woBlXw" );
         connection.modify( modReq );
 
@@ -490,7 +498,8 @@ public class SimpleAuthenticationIT exte
         connection.bind( adminUserDn, "secret" );
 
         // now modify the password for akarasulu (while we're admin)
-        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( userDn ) );
         modReq.replace( "userPassword", "newpwd" );
         connection.modify( modReq );
         connection.close();

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=986083&r1=986082&r2=986083&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 Mon Aug 16 18:11:21 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.ModifyRequest;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.CreateDS;
@@ -53,10 +52,12 @@ import org.apache.directory.shared.ldap.
 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.ModifyRequestImpl;
 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.InternalModifyRequest;
 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;
@@ -218,8 +219,9 @@ public class PasswordPolicyTest extends 
         PasswordPolicyResponseControl respCtrl = getPwdRespCtrl( addResp );
         assertNull( respCtrl );
 
-        ModifyRequest modReq = new ModifyRequest( userDn );
-        modReq.add( PP_REQ_CTRL );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( userDn );
+        modReq.addControl( PP_REQ_CTRL );
         modReq.replace( SchemaConstants.USER_PASSWORD_AT, "123456" );
 
         ModifyResponse modResp = connection.modify( modReq );

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java Mon Aug 16 18:11:21 2010
@@ -29,7 +29,6 @@ import java.util.HashSet;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.integ.IntegrationUtils;
@@ -37,8 +36,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.internal.DeleteResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.internal.Response;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
@@ -96,8 +97,7 @@ public class AuthorizationServiceAsAdmin
     @Test
     public void testNoRdnChangesOnAdminByAdmin() throws Exception
     {
-        ModifyDnResponse resp = getAdminConnection().rename( new DN( "uid=admin,ou=system" ),
-            new RDN( "uid=alex" ) );
+        ModifyDnResponse resp = getAdminConnection().rename( new DN( "uid=admin,ou=system" ), new RDN( "uid=alex" ) );
         assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, resp.getLdapResult().getResultCode() );
     }
 
@@ -111,15 +111,16 @@ public class AuthorizationServiceAsAdmin
     public void testModifyOnAdminByAdmin() throws Exception
     {
         LdapConnection connection = getAdminConnection();
-        DN adminDN = new DN( "uid=admin,ou=system" );
-        ModifyRequest req = new ModifyRequest( adminDN );
+        DN adminDn = new DN( "uid=admin,ou=system" );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( adminDn );
         String newPwd = "replaced";
-        req.replace( SchemaConstants.USER_PASSWORD_AT, newPwd );
-        connection.modify( req );
+        modReq.replace( SchemaConstants.USER_PASSWORD_AT, newPwd );
+        connection.modify( modReq );
         connection.close();
 
-        connection = getConnectionAs( adminDN, newPwd );
-        Entry entry = ( ( SearchResultEntry ) connection.lookup( adminDN.getName() ) ).getEntry();
+        connection = getConnectionAs( adminDn, newPwd );
+        Entry entry = ( ( SearchResultEntry ) connection.lookup( adminDn.getName() ) ).getEntry();
         assertTrue( ArrayUtils.isEquals( StringTools.getBytesUtf8( newPwd ), entry.get( "userPassword" ).get()
             .getBytes() ) );
     }

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java Mon Aug 16 18:11:21 2010
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.IntegrationUtils;
@@ -29,8 +28,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 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.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 
@@ -177,7 +178,8 @@ public class AutzIntegUtils
     {
         LdapConnection connection = getAdminConnection();
 
-        ModifyRequest modReq = new ModifyRequest( new DN( "cn=" + groupCn + ",ou=groups,ou=system" ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( "cn=" + groupCn + ",ou=groups,ou=system" ) );
         modReq.add( SchemaConstants.UNIQUE_MEMBER_AT, "uid=" + userUid + ",ou=users,ou=system" );
 
         connection.modify( modReq ).getLdapResult().getResultCode();
@@ -193,7 +195,8 @@ public class AutzIntegUtils
      */
     public static void removeUserFromGroup( String userUid, String groupCn ) throws Exception
     {
-        ModifyRequest modReq = new ModifyRequest( new DN( "cn=" + groupCn + ",ou=groups,ou=system" ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( "cn=" + groupCn + ",ou=groups,ou=system" ) );
         modReq.remove( SchemaConstants.UNIQUE_MEMBER_AT, "uid=" + userUid + ",ou=users,ou=system" );
         getAdminConnection().modify( modReq );
     }
@@ -241,7 +244,8 @@ public class AutzIntegUtils
 
         if ( administrativeRole == null || !administrativeRole.contains( "accessControlSpecificArea" ) )
         {
-            ModifyRequest modReq = new ModifyRequest( systemEntry.getDn() );
+            InternalModifyRequest modReq = new ModifyRequestImpl();
+            modReq.setName( systemEntry.getDn() );
             modReq.add( "administrativeRole", "accessControlSpecificArea" );
             connection.modify( modReq );
         }
@@ -270,7 +274,8 @@ public class AutzIntegUtils
     public static void addEntryACI( DN dn, String aciItem ) throws Exception
     {
         // modify the entry relative to ou=system to include the aciItem
-        ModifyRequest modReq = new ModifyRequest( dn );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( dn );
         modReq.add( "entryACI", aciItem );
 
         getAdminConnection().modify( modReq );
@@ -286,7 +291,8 @@ public class AutzIntegUtils
     public static void addSubentryACI( String aciItem ) throws Exception
     {
         // modify the entry relative to ou=system to include the aciItem
-        ModifyRequest modReq = new ModifyRequest( new DN( "ou=system" ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( "ou=system" ) );
         modReq.add( "subentryACI", aciItem );
         getAdminConnection().modify( modReq );
     }
@@ -302,15 +308,17 @@ public class AutzIntegUtils
      */
     public static void changePresciptiveACI( String cn, String aciItem ) throws Exception
     {
-        ModifyRequest req = new ModifyRequest( new DN( "cn=" + cn + "," + ServerDNConstants.SYSTEM_DN ) );
-        req.replace( "prescriptiveACI", aciItem );
-        getAdminConnection().modify( req );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( "cn=" + cn + "," + ServerDNConstants.SYSTEM_DN ) );
+        modReq.replace( "prescriptiveACI", aciItem );
+        getAdminConnection().modify( modReq );
     }
 
 
     public static void addPrescriptiveACI( String cn, String aciItem ) throws Exception
     {
-        ModifyRequest modReq = new ModifyRequest( new DN( "cn=" + cn + "," + ServerDNConstants.SYSTEM_DN ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( "cn=" + cn + "," + ServerDNConstants.SYSTEM_DN ) );
         modReq.add( "prescriptiveACI", aciItem );
         getAdminConnection().modify( modReq );
     }

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java Mon Aug 16 18:11:21 2010
@@ -32,7 +32,6 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertTrue;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
@@ -45,7 +44,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
@@ -118,8 +119,14 @@ public class ModifyAuthorizationIT exten
         LdapConnection userConnection = getConnectionAs( userName, password );
 
         // modify the entry as the user
-        ModifyRequest modReq = new ModifyRequest( entryDN );
-        modReq.addModification( mods );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( entryDN );
+
+        for ( Modification modification : mods )
+        {
+            modReq.addModification( modification );
+        }
+
         ModifyResponse resp = userConnection.modify( modReq );
 
         if ( resp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
@@ -177,7 +184,8 @@ public class ModifyAuthorizationIT exten
         DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
         // modify the entry as the user
         LdapConnection userConnection = getConnectionAs( userName, password );
-        ModifyRequest modReq = new ModifyRequest( entryDN );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( entryDN );
         modReq.addModification( attr, modOp );
 
         ModifyResponse resp = userConnection.modify( modReq );
@@ -216,8 +224,13 @@ public class ModifyAuthorizationIT exten
         DN userDN = new DN( "uid=" + uid + ",ou=users,ou=system" );
         LdapConnection connection = getConnectionAs( userDN, password );
 
-        ModifyRequest modReq = new ModifyRequest( userDN );
-        modReq.addModification( mods );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( userDN );
+
+        for ( Modification modification : mods )
+        {
+            modReq.addModification( modification );
+        }
 
         ModifyResponse resp = connection.modify( modReq );
 

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java Mon Aug 16 18:11:21 2010
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTru
 import java.util.Arrays;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -39,6 +38,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
@@ -289,7 +290,8 @@ public class DefaultChangeLogIT extends 
         assertPresent( sysRoot, "ou=test5,ou=system" );
 
         // modify the test entry to add description and test new attr appears
-        ModifyRequest modReq = new ModifyRequest( entry.getDn() );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( entry.getDn() );
         modReq.add( "description", "a desc value" );
         sysRoot.modify( modReq );
 
@@ -310,7 +312,8 @@ public class DefaultChangeLogIT extends 
         // -------------------------------------------------------------------
 
         // add the attribute again and make sure it is old value
-        modReq = new ModifyRequest( resusitated.getDn() );
+        modReq = new ModifyRequestImpl();
+        modReq.setName( resusitated.getDn() );
         modReq.add( "description", "old value" );
         sysRoot.modify( modReq );
         resusitated = ( ( SearchResultEntry ) sysRoot.lookup( "ou=test5,ou=system" ) ).getEntry();
@@ -321,7 +324,8 @@ public class DefaultChangeLogIT extends 
 
         // now tag then replace the value to "new value" and confirm
         Tag t1 = service.getChangeLog().tag();
-        modReq = new ModifyRequest( resusitated.getDn() );
+        modReq = new ModifyRequestImpl();
+        modReq.setName( resusitated.getDn() );
         modReq.replace( "description", "new value" );
         sysRoot.modify( modReq );
 
@@ -344,7 +348,8 @@ public class DefaultChangeLogIT extends 
         // -------------------------------------------------------------------
 
         Tag t2 = service.getChangeLog().tag();
-        modReq = new ModifyRequest( resusitated.getDn() );
+        modReq = new ModifyRequestImpl();
+        modReq.setName( resusitated.getDn() );
         modReq.remove( "description", "old value" );
         sysRoot.modify( modReq );
 
@@ -366,13 +371,15 @@ public class DefaultChangeLogIT extends 
         // -------------------------------------------------------------------
 
         // add a userPassword attribute so we can test replacing it
-        modReq = new ModifyRequest( resusitated.getDn() );
+        modReq = new ModifyRequestImpl();
+        modReq.setName( resusitated.getDn() );
         modReq.add( "userPassword", "to be replaced" );
         sysRoot.modify( modReq );
         resusitated = ( ( SearchResultEntry ) sysRoot.lookup( "ou=test5,ou=system" ) ).getEntry();
         assertPassword( resusitated, "to be replaced" );
 
-        modReq = new ModifyRequest( resusitated.getDn() );
+        modReq = new ModifyRequestImpl();
+        modReq.setName( resusitated.getDn() );
         modReq.remove( "description", "old value" );
         modReq.add( "seeAlso", "ou=added" );
         modReq.replace( "userPassword", "a replaced value" );

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java Mon Aug 16 18:11:21 2010
@@ -28,7 +28,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.ModifyRequest;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -40,9 +39,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 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.DeleteResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.message.internal.Response;
@@ -120,8 +121,8 @@ public class ExceptionServiceIT extends 
     @Test
     public void testSearchControl() throws Exception
     {
-        Cursor<Response> cursor = getAdminConnection( service ).search( "ou=users,ou=system",
-            "(objectClass=*)", SearchScope.ONELEVEL, "*" );
+        Cursor<Response> cursor = getAdminConnection( service ).search( "ou=users,ou=system", "(objectClass=*)",
+            SearchScope.ONELEVEL, "*" );
 
         assertFalse( cursor.next() );
     }
@@ -264,7 +265,8 @@ public class ExceptionServiceIT extends 
     {
         LdapConnection connection = getAdminConnection( service );
 
-        ModifyRequest modReq = new ModifyRequest( new DN( "ou=blah,ou=system" ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( "ou=blah,ou=system" ) );
         modReq.add( SchemaConstants.OU_AT, "another-value" );
 
         ModifyResponse modResp = connection.modify( modReq );
@@ -283,7 +285,8 @@ public class ExceptionServiceIT extends 
     {
         LdapConnection connection = getAdminConnection( service );
 
-        ModifyRequest modReq = new ModifyRequest( new DN( "ou=users,ou=system" ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( "ou=users,ou=system" ) );
         modReq.add( SchemaConstants.OU_AT, "dummyValue" );
 
         connection.modify( modReq );

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java Mon Aug 16 18:11:21 2010
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.core.annotations.ContextEntry;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.annotations.CreateIndex;
@@ -36,6 +35,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -94,7 +95,8 @@ public class ModifyPerfIT extends Abstra
                 t00 = System.currentTimeMillis();
             }
 
-            ModifyRequest modRequest = new ModifyRequest( dn );
+            InternalModifyRequest modRequest = new ModifyRequestImpl();
+            modRequest.setName( dn );
             Modification modification = new DefaultModification();
             EntryAttribute attribute = new DefaultEntryAttribute( "sn" );
 
@@ -113,7 +115,8 @@ public class ModifyPerfIT extends Abstra
         long t1 = System.currentTimeMillis();
 
         Long deltaWarmed = ( t1 - t00 );
-        System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 5000 ) * 1000 ) / deltaWarmed ) + " per s ) /" + ( t1 - t0 ) );
+        System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 5000 ) * 1000 ) / deltaWarmed )
+            + " per s ) /" + ( t1 - t0 ) );
         connection.close();
     }
 }

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Mon Aug 16 18:11:21 2010
@@ -58,7 +58,6 @@ import javax.naming.directory.SearchResu
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
@@ -66,7 +65,9 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -128,7 +129,8 @@ public class SubschemaSubentryIT extends
     {
         LdapConnection conn = getAdminConnection( service );
 
-        ModifyRequest modRequest = new ModifyRequest( new DN( GLOBAL_SUBSCHEMA_DN ) );
+        InternalModifyRequest modRequest = new ModifyRequestImpl();
+        modRequest.setName( new DN( GLOBAL_SUBSCHEMA_DN ) );
         modRequest.add( "attributeTypes", "( 2.5.4.58 NAME 'attributeCertificateAttribute' "
             + " DESC 'attribute certificate use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )" );
         ModifyResponse response = conn.modify( modRequest );

Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java Mon Aug 16 18:11:21 2010
@@ -42,7 +42,6 @@ import javax.naming.directory.SearchResu
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -56,10 +55,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.jndi.JndiUtils;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 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.DeleteResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.Response;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
@@ -204,7 +205,8 @@ public class SubentryServiceIT extends A
 
     private void addAdministrativeRole( LdapConnection connection, String dn, String role ) throws Exception
     {
-        ModifyRequest modifyRequest = new ModifyRequest( new DN( dn ) );
+        InternalModifyRequest modifyRequest = new ModifyRequestImpl();
+        modifyRequest.setName( new DN( dn ) );
         modifyRequest.add( "administrativeRole", role );
         connection.modify( modifyRequest );
     }
@@ -425,8 +427,7 @@ public class SubentryServiceIT extends A
         }
 
         // Now delete the AP-B subentry
-        DeleteResponse deleteResponse = connection
-            .delete( "cn=testsubentryB,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system" );
+        DeleteResponse deleteResponse = connection.delete( "cn=testsubentryB,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system" );
 
         // --------------------------------------------------------------------
         // Check that we are back to where we were before the addition of the B

Modified: directory/apacheds/branches/apacheds-codec-merge/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java Mon Aug 16 18:11:21 2010
@@ -31,14 +31,15 @@ import netscape.ldap.LDAPException;
 import netscape.ldap.LDAPModification;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
@@ -84,7 +85,8 @@ public class IllegalModificationIT exten
     {
         LdapConnection con = getClientApiConnection( ldapServer );
 
-        ModifyRequest modReq = new ModifyRequest( new DN( DN ) );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( DN ) );
         modReq.add( "description", "" );
 
         ModifyResponse resp = con.modify( modReq );

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=986083&r1=986082&r2=986083&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 Mon Aug 16 18:11:21 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.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
@@ -57,6 +56,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.DeleteRequestImpl;
 import org.apache.directory.shared.ldap.message.LdapProtocolEncoder;
 import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.UnbindRequestImpl;
 import org.apache.directory.shared.ldap.message.internal.BindResponse;
@@ -66,6 +66,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -369,7 +370,7 @@ public class ImportCommand extends ToolC
 
         modifyDNRequest.setMessageId( messageId );
 
-        // Encode and send the delete request
+        // Encode and send the modifyDn request
         LdapProtocolEncoder encoder = new LdapProtocolEncoder();
 
         ByteBuffer bb = encoder.encodeMessage( modifyDNRequest );
@@ -411,7 +412,7 @@ public class ImportCommand extends ToolC
     private int changeModifyEntry( LdifEntry entry, int messageId ) throws IOException, DecoderException,
         LdapInvalidDnException, EncoderException
     {
-        ModifyRequestCodec modifyRequest = new ModifyRequestCodec();
+        InternalModifyRequest modifyRequest = new ModifyRequestImpl();
 
         String dn = entry.getDn().getName();
 
@@ -420,24 +421,19 @@ public class ImportCommand extends ToolC
             System.out.println( "Modify of entry " + dn );
         }
 
-        modifyRequest.setObject( new DN( dn ) );
-        modifyRequest.initModifications();
+        modifyRequest.setName( new DN( dn ) );
 
         for ( Modification modification : entry.getModificationItems() )
         {
-            modifyRequest.setCurrentOperation( modification.getOperation() );
-            modifyRequest.addAttributeTypeAndValues( modification.getAttribute().getId() );
-
-            for ( Value<?> value : modification.getAttribute() )
-            {
-                modifyRequest.addAttributeValue( value );
-            }
+            modifyRequest.addModification( modification );
         }
 
         modifyRequest.setMessageId( messageId );
 
         // Encode and send the delete request
-        ByteBuffer bb = modifyRequest.encode();
+        LdapProtocolEncoder encoder = new LdapProtocolEncoder();
+
+        ByteBuffer bb = encoder.encodeMessage( modifyRequest );
         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=986083&r1=986082&r2=986083&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 Mon Aug 16 18:11:21 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.ModifyRequest;
 import org.apache.directory.ldap.client.api.message.SearchRequest;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
@@ -22,6 +21,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -133,7 +133,7 @@ public interface LdapAsyncConnection ext
      * @return the modify operation's future
      * @throws LdapException in case of modify operation failure or timeout happens
      */
-    ModifyFuture modifyAsync( ModifyRequest modRequest ) throws LdapException;
+    ModifyFuture modifyAsync( InternalModifyRequest modRequest ) 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=986083&r1=986082&r2=986083&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 Mon Aug 16 18:11:21 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.ModifyRequest;
 import org.apache.directory.ldap.client.api.message.SearchRequest;
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.ldap.cursor.Cursor;
@@ -26,6 +25,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.message.internal.Response;
@@ -268,10 +268,10 @@ public interface LdapConnection
      * the ModifyRequest.
      *
      * @param modRequest the request for modify operation
-     * @return the modify operation's r"esponse
+     * @return the modify operation's response
      * @throws LdapException in case of modify operation failure or timeout happens
      */
-    public abstract ModifyResponse modify( ModifyRequest modRequest ) throws LdapException;
+    public abstract ModifyResponse modify( InternalModifyRequest modRequest ) 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=986083&r1=986082&r2=986083&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 Mon Aug 16 18:11:21 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.ModifyRequest;
 import org.apache.directory.ldap.client.api.message.SearchRequest;
 import org.apache.directory.ldap.client.api.protocol.LdapProtocolCodecFactory;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
@@ -62,7 +61,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.LdapTransformer;
 import org.apache.directory.shared.ldap.codec.MessageEncoderException;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -87,6 +85,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.message.IntermediateResponseImpl;
 import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.UnbindRequestImpl;
 import org.apache.directory.shared.ldap.message.control.Control;
@@ -104,6 +103,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
@@ -1762,7 +1762,8 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( "Entry to be modified cannot be null" );
         }
 
-        ModifyRequest modReq = new ModifyRequest( entry.getDn() );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( entry.getDn() );
 
         Iterator<EntryAttribute> itr = entry.iterator();
         while ( itr.hasNext() )
@@ -1785,8 +1786,13 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( "The DN to be modified cannot be null" );
         }
 
-        ModifyRequest modReq = new ModifyRequest( dn );
-        modReq.addModification( modifications );
+        InternalModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( dn );
+
+        for ( Modification modification : modifications )
+        {
+            modReq.addModification( modification );
+        }
 
         return modify( modReq );
     }
@@ -1804,7 +1810,7 @@ public class LdapNetworkConnection exten
     /**
      * {@inheritDoc}
      */
-    public ModifyResponse modify( ModifyRequest modRequest ) throws LdapException
+    public ModifyResponse modify( InternalModifyRequest modRequest ) throws LdapException
     {
         ModifyFuture modifyFuture = modifyAsync( modRequest );
 
@@ -1812,10 +1818,8 @@ public class LdapNetworkConnection exten
         try
         {
             // Read the response, waiting for it if not available immediately
-            long timeout = getTimeout( modRequest.getTimeout() );
-
             // Get the response, blocking
-            ModifyResponse modifyResponse = modifyFuture.get( timeout, TimeUnit.MILLISECONDS );
+            ModifyResponse modifyResponse = modifyFuture.get( timeOut, TimeUnit.MILLISECONDS );
 
             if ( modifyResponse == null )
             {
@@ -1870,26 +1874,18 @@ public class LdapNetworkConnection exten
     /**
      * {@inheritDoc}
      */
-    public ModifyFuture modifyAsync( ModifyRequest modRequest ) throws LdapException
+    public ModifyFuture modifyAsync( InternalModifyRequest modRequest ) throws LdapException
     {
         checkSession();
 
-        ModifyRequestCodec modReqCodec = new ModifyRequestCodec();
-
         int newId = messageId.incrementAndGet();
         modRequest.setMessageId( newId );
-        modReqCodec.setMessageId( newId );
-
-        modReqCodec.setModifications( modRequest.getMods() );
-        modReqCodec.setObject( modRequest.getDn() );
-
-        setControls( modRequest.getControls(), modReqCodec );
 
         ModifyFuture modifyFuture = new ModifyFuture( this, newId );
         addToFutureMap( newId, modifyFuture );
 
         // Send the request to the server
-        WriteFuture writeFuture = ldapSession.write( modReqCodec );
+        WriteFuture writeFuture = ldapSession.write( modRequest );
 
         // Wait for the message to be sent to the server
         if ( !writeFuture.awaitUninterruptibly( getTimeout( 0 ) ) )

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java (original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java Mon Aug 16 18:11:21 2010
@@ -22,7 +22,6 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.ldap.codec.controls.AbstractControl;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.message.internal.AddResponse;
 import org.apache.directory.shared.ldap.message.internal.BindResponse;
@@ -38,6 +37,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
@@ -250,9 +250,9 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the ModifyRequest stored in the container
      */
-    public ModifyRequestCodec getModifyRequest()
+    public InternalModifyRequest getModifyRequest()
     {
-        return ( ModifyRequestCodec ) ldapMessage;
+        return ( InternalModifyRequest ) internalMessage;
     }
 
 

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Mon Aug 16 18:11:21 2010
@@ -72,7 +72,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.actions.ValueAction;
 import org.apache.directory.shared.ldap.codec.controls.ControlEnum;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
@@ -93,6 +92,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.IntermediateResponseImpl;
 import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ModifyResponseImpl;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -115,6 +115,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalReferral;
 import org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest;
 import org.apache.directory.shared.ldap.message.internal.LdapResult;
@@ -1426,9 +1427,8 @@ public class LdapMessageGrammar extends 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
                     // Now, we can allocate the ModifyRequest Object
-                    ModifyRequestCodec modifyRequest = new ModifyRequestCodec();
-                    modifyRequest.setMessageId( ldapMessageContainer.getMessageId() );
-                    ldapMessageContainer.setLdapMessage( modifyRequest );
+                    InternalModifyRequest modifyRequest = new ModifyRequestImpl( ldapMessageContainer.getMessageId() );
+                    ldapMessageContainer.setInternalMessage( modifyRequest );
                 }
             } );
 
@@ -1448,7 +1448,7 @@ public class LdapMessageGrammar extends 
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    ModifyRequestCodec modifyRequest = ldapMessageContainer.getModifyRequest();
+                    InternalModifyRequest modifyRequest = ldapMessageContainer.getModifyRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -1457,7 +1457,7 @@ public class LdapMessageGrammar extends 
                     // Store the value.
                     if ( tlv.getLength() == 0 )
                     {
-                        modifyRequest.setObject( object );
+                        modifyRequest.setName( object );
                     }
                     else
                     {
@@ -1479,12 +1479,12 @@ public class LdapMessageGrammar extends 
                                 DN.EMPTY_DN, ine );
                         }
 
-                        modifyRequest.setObject( object );
+                        modifyRequest.setName( object );
                     }
 
                     if ( IS_DEBUG )
                     {
-                        log.debug( "Modification of DN {}", modifyRequest.getObject() );
+                        log.debug( "Modification of DN {}", modifyRequest.getName() );
                     }
                 }
             } );
@@ -1499,18 +1499,7 @@ public class LdapMessageGrammar extends 
         //
         // Initialize the modifications list
         super.transitions[LdapStatesEnum.OBJECT_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
-            LdapStatesEnum.OBJECT_STATE, LdapStatesEnum.MODIFICATIONS_STATE, UniversalTag.SEQUENCE_TAG,
-            new GrammarAction( "Init modifications array list" )
-            {
-                public void action( IAsn1Container container )
-                {
-
-                    LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    ModifyRequestCodec modifyRequest = ldapMessageContainer.getModifyRequest();
-
-                    modifyRequest.initModifications();
-                }
-            } );
+            LdapStatesEnum.OBJECT_STATE, LdapStatesEnum.MODIFICATIONS_STATE, UniversalTag.SEQUENCE_TAG, null );
 
         // --------------------------------------------------------------------------------------------
         // Transition from modifications to modification sequence
@@ -1542,7 +1531,7 @@ public class LdapMessageGrammar extends 
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    ModifyRequestCodec modifyRequest = ldapMessageContainer.getModifyRequest();
+                    InternalModifyRequest modifyRequest = ldapMessageContainer.getModifyRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -1563,7 +1552,7 @@ public class LdapMessageGrammar extends 
                     }
 
                     // Store the current operation.
-                    modifyRequest.setCurrentOperation( operation );
+                    ( ( ModifyRequestImpl ) modifyRequest ).setCurrentOperation( operation );
 
                     if ( IS_DEBUG )
                     {
@@ -1624,7 +1613,7 @@ public class LdapMessageGrammar extends 
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    ModifyRequestCodec modifyRequest = ldapMessageContainer.getModifyRequest();
+                    InternalModifyRequest modifyRequest = ldapMessageContainer.getModifyRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -1638,12 +1627,12 @@ public class LdapMessageGrammar extends 
 
                         ModifyResponseImpl response = new ModifyResponseImpl( modifyRequest.getMessageId() );
                         throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
-                            modifyRequest.getObject(), null );
+                            modifyRequest.getName(), null );
                     }
                     else
                     {
                         type = StringTools.getType( tlv.getValue().getData() );
-                        modifyRequest.addAttributeTypeAndValues( type );
+                        ( ( ModifyRequestImpl ) modifyRequest ).addAttributeTypeAndValues( type );
                     }
 
                     if ( IS_DEBUG )

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java (original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java Mon Aug 16 18:11:21 2010
@@ -25,7 +25,6 @@ import java.util.List;
 
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.AndFilter;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.ConnectorFilter;
@@ -37,7 +36,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.filter.AndNode;
 import org.apache.directory.shared.ldap.filter.ApproximateNode;
@@ -54,7 +52,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
@@ -78,34 +75,6 @@ public class LdapTransformer
 
 
     /**
-     * Transform a ModifyRequest message from a CodecMessage to a InternalMessage
-     * 
-     * @param modifyRequest The message to transform
-     * @param messageId The message Id
-     * @return A Internal ModifyRequestImpl
-     */
-    private static InternalMessage transformModifyRequest( ModifyRequestCodec modifyRequest, int messageId )
-    {
-        ModifyRequestImpl internalMessage = new ModifyRequestImpl( messageId );
-
-        // Codec : DN object -> Internal : String name
-        internalMessage.setName( modifyRequest.getObject() );
-
-        // Codec : ArrayList modifications -> Internal : ArrayList mods
-        if ( modifyRequest.getModifications() != null )
-        {
-            // Loop through the modifications
-            for ( Modification modification : modifyRequest.getModifications() )
-            {
-                internalMessage.addModification( modification );
-            }
-        }
-
-        return internalMessage;
-    }
-
-
-    /**
      * Transform the Filter part of a SearchRequest to an ExprNode
      * 
      * @param codecFilter The filter to be transformed
@@ -499,9 +468,6 @@ public class LdapTransformer
                 break;
 
             case MODIFY_REQUEST:
-                internalMessage = transformModifyRequest( ( ModifyRequestCodec ) codecMessage, messageId );
-                break;
-
             case MODIFYDN_REQUEST:
             case EXTENDED_REQUEST:
             case SEARCH_RESULT_ENTRY:

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java?rev=986083&r1=986082&r2=986083&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java (original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java Mon Aug 16 18:11:21 2010
@@ -24,7 +24,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -43,18 +44,20 @@ public class ModifyAttributeValueAction 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = log.isDebugEnabled();
 
+
     public ModifyAttributeValueAction()
     {
         super( "Stores AttributeValue" );
     }
 
+
     /**
      * The initialization action
      */
     public void action( IAsn1Container container )
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        ModifyRequestCodec modifyRequest = ldapMessageContainer.getModifyRequest();
+        InternalModifyRequest modifyRequest = ldapMessageContainer.getModifyRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -63,19 +66,20 @@ public class ModifyAttributeValueAction 
 
         if ( tlv.getLength() == 0 )
         {
-            modifyRequest.addAttributeValue( "" );
+            ( ( ModifyRequestImpl ) modifyRequest ).addAttributeValue( "" );
         }
         else
         {
             value = tlv.getValue().getData();
 
-            if ( ldapMessageContainer.isBinary( modifyRequest.getCurrentAttributeType() ) )
+            if ( ldapMessageContainer.isBinary( ( ( ModifyRequestImpl ) modifyRequest ).getCurrentAttributeType() ) )
             {
-                modifyRequest.addAttributeValue( value );
+                ( ( ModifyRequestImpl ) modifyRequest ).addAttributeValue( value );
             }
             else
             {
-                modifyRequest.addAttributeValue( StringTools.utf8ToString( ( byte[] ) value ) );
+                ( ( ModifyRequestImpl ) modifyRequest )
+                    .addAttributeValue( StringTools.utf8ToString( ( byte[] ) value ) );
             }
         }
 



Mime
View raw message