directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r987611 [13/13] - in /directory/apacheds/trunk: ./ all/ core-annotations/ core-api/ core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/event/ core-api/src/main/java/org/apache/di...
Date Fri, 20 Aug 2010 19:32:02 GMT
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java Fri Aug 20 19:31:58 2010
@@ -47,14 +47,14 @@ import netscape.ldap.LDAPUrl;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
-import org.apache.directory.ldap.client.api.message.BindResponse;
-import org.apache.directory.ldap.client.api.message.LdapResult;
 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.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.message.BindResponse;
+import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -65,30 +65,21 @@ import org.junit.runner.RunWith;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class ) 
-@ApplyLdifs( {
-    // Entry # 1
-    "dn: uid=hnelson,ou=users,ou=system",
-    "objectClass: inetOrgPerson",
-    "objectClass: organizationalPerson",
-    "objectClass: person",
-    "objectClass: top",
-    "userPassword: secret",
-    "uid: hnelson",
-    "cn: Horatio Nelson",
-    "sn: Nelson"
-    }
-)
-@CreateDS( allowAnonAccess=true, name="SimpleBindIT-class")
-@CreateLdapServer ( 
-    transports = 
+@RunWith(FrameworkRunner.class)
+@ApplyLdifs(
     {
-        @CreateTransport( protocol = "LDAP" )
-    })
+        // Entry # 1
+        "dn: uid=hnelson,ou=users,ou=system", "objectClass: inetOrgPerson", "objectClass: organizationalPerson",
+        "objectClass: person", "objectClass: top", "userPassword: secret", "uid: hnelson", "cn: Horatio Nelson",
+        "sn: Nelson" })
+@CreateDS(allowAnonAccess = true, name = "SimpleBindIT-class")
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
 public class SimpleBindIT extends AbstractLdapTestUnit
 {
     private static final String BASE = "ou=users,ou=system";
 
+
     /**
      * Convenience method for creating a person.
      */
@@ -191,7 +182,7 @@ public class SimpleBindIT extends Abstra
         }
     }
 
-    
+
     /**
      * try to connect using a user with an invalid DN: we should get a invalidDNSyntax error.
      */
@@ -221,7 +212,7 @@ public class SimpleBindIT extends Abstra
         }
     }
 
-    
+
     /**
      * try to connect using a unknown user: we should get a invalidCredentials error.
      */
@@ -244,11 +235,11 @@ public class SimpleBindIT extends Abstra
         }
         catch ( NamingException e )
         {
-            fail( "Expected AuthenticationException with error code 49 for invalidate credentials instead got: " 
+            fail( "Expected AuthenticationException with error code 49 for invalidate credentials instead got: "
                 + e.getMessage() );
         }
     }
-    
+
 
     /**
      * covers the anonymous authentication : we should be able to read the rootDSE, but that's it
@@ -267,28 +258,30 @@ public class SimpleBindIT extends Abstra
         env.put( Context.SECURITY_PRINCIPAL, "" );
         env.put( Context.SECURITY_CREDENTIALS, "" );
 
-        String[] attrIDs = { "*", "+" };
-        
+        String[] attrIDs =
+            { "*", "+" };
+
         // Create the initial context
         try
         {
-            new InitialDirContext(env);
+            new InitialDirContext( env );
             fail();
         }
         catch ( NamingException ne )
         {
             // Expected, as the server forbid anonymous access
         }
-        
+
         // Check that we can read the rootDSE
         try
         {
             // Use the netscape API as JNDI cannot be used to do a search without
             // first binding.
-            LDAPUrl url = new LDAPUrl( "localhost", ldapServer.getPort(), "", new String[]{"vendorName"}, 0, "(ObjectClass=*)" );
+            LDAPUrl url = new LDAPUrl( "localhost", ldapServer.getPort(), "", new String[]
+                { "vendorName" }, 0, "(ObjectClass=*)" );
             LDAPSearchResults results = LDAPConnection.search( url );
 
-            if ( results.hasMoreElements() ) 
+            if ( results.hasMoreElements() )
             {
                 LDAPEntry entry = results.next();
 
@@ -318,8 +311,8 @@ public class SimpleBindIT extends Abstra
         {
             // Use the netscape API as JNDI cannot be used to do a search without
             // first binding.
-            LDAPUrl url = new LDAPUrl( "localhost", ldapServer.getPort(), 
-                "uid=admin,ou=system", attrIDs, 0, "(ObjectClass=*)" );
+            LDAPUrl url = new LDAPUrl( "localhost", ldapServer.getPort(), "uid=admin,ou=system", attrIDs, 0,
+                "(ObjectClass=*)" );
             LDAPConnection.search( url );
 
             fail();
@@ -327,14 +320,14 @@ public class SimpleBindIT extends Abstra
         catch ( LDAPException e )
         {
             // Expected
-            assertTrue( true);
+            assertTrue( true );
         }
-        
+
         ldapServer.getDirectoryService().setAllowAnonymousAccess( oldValue );
         ldapServer.setAllowAnonymousAccess( oldValue );
     }
-    
-    
+
+
     /**
      * covers the Unauthenticated case : we should get a UnwillingToPerform error.
      */
@@ -351,7 +344,7 @@ public class SimpleBindIT extends Abstra
         // Create the initial context
         try
         {
-            new InitialDirContext(env);
+            new InitialDirContext( env );
         }
         catch ( OperationNotSupportedException onse )
         {
@@ -362,9 +355,9 @@ public class SimpleBindIT extends Abstra
         {
             fail();
         }
-    }    
-    
-    
+    }
+
+
     /**
      * not allowed by the server. We should get a invalidCredentials error.
      */
@@ -382,7 +375,7 @@ public class SimpleBindIT extends Abstra
         // Create the initial context
         try
         {
-            new InitialDirContext(env);
+            new InitialDirContext( env );
         }
         catch ( AuthenticationException ae )
         {
@@ -391,7 +384,7 @@ public class SimpleBindIT extends Abstra
         {
             fail( "Expected AuthenticationException but instead got: " + ne.getMessage() );
         }
-    }    
+    }
 
 
     /**
@@ -401,7 +394,7 @@ public class SimpleBindIT extends Abstra
     @Test
     public void testAnonymousRootDSESearch()
     {
-        
+
         boolean oldValue = ldapServer.getDirectoryService().isAllowAnonymousAccess();
         ldapServer.getDirectoryService().setAllowAnonymousAccess( false );
 
@@ -409,10 +402,11 @@ public class SimpleBindIT extends Abstra
         {
             // Use the netscape API as JNDI cannot be used to do a search without
             // first binding.
-            LDAPUrl url = new LDAPUrl( "localhost", ldapServer.getPort(), "", new String[]{"vendorName"}, 0, "(ObjectClass=*)" );
+            LDAPUrl url = new LDAPUrl( "localhost", ldapServer.getPort(), "", new String[]
+                { "vendorName" }, 0, "(ObjectClass=*)" );
             LDAPSearchResults results = LDAPConnection.search( url );
 
-            if ( results.hasMoreElements() ) 
+            if ( results.hasMoreElements() )
             {
                 LDAPEntry entry = results.next();
 
@@ -442,7 +436,7 @@ public class SimpleBindIT extends Abstra
         }
     }
 
-    
+
     /**
      * Tests bind operation on referral entry.
      */
@@ -450,7 +444,7 @@ public class SimpleBindIT extends Abstra
     public void testBindWithDoubleQuote() throws Exception
     {
         LdapConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
-        
+
         BindResponse response = connection.bind( "uid=\"admin\",ou=\"system\"", "secret" );
         LdapResult ldapResult = response.getLdapResult();
         assertEquals( ResultCodeEnum.SUCCESS, ldapResult.getResultCode() );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java Fri Aug 20 19:31:58 2010
@@ -43,12 +43,12 @@ import netscape.ldap.LDAPResponse;
 import netscape.ldap.LDAPResponseListener;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.CompareResponse;
 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.message.CompareResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -61,43 +61,31 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class ) 
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" )
-    })
-@ApplyLdifs( {
-    // Entry # 1
-    "dn: uid=akarasulu,ou=users,ou=system",
-    "objectClass: uidObject",
-    "objectClass: person",
-    "objectClass: top",
-    "uid: akarasulu",
-    "cn: Alex Karasulu",
-    "sn: karasulu", 
-    // Entry # 2
-    "dn: ou=Computers,uid=akarasulu,ou=users,ou=system",
-    "objectClass: organizationalUnit",
-    "objectClass: top",
-    "ou: computers",
-    "description: Computers for Alex",
-    "seeAlso: ou=Machines,uid=akarasulu,ou=users,ou=system", 
-    // Entry # 3
-    "dn: uid=akarasuluref,ou=users,ou=system",
-    "objectClass: uidObject",
-    "objectClass: referral",
-    "objectClass: top",
-    "uid: akarasuluref",
-    "ref: ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", 
-    "ref: ldap://foo:10389/uid=akarasulu,ou=users,ou=system",
-    "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system"
-    }
-)
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
+@ApplyLdifs(
+    {
+        // Entry # 1
+        "dn: uid=akarasulu,ou=users,ou=system", "objectClass: uidObject", "objectClass: person",
+        "objectClass: top",
+        "uid: akarasulu",
+        "cn: Alex Karasulu",
+        "sn: karasulu",
+        // Entry # 2
+        "dn: ou=Computers,uid=akarasulu,ou=users,ou=system", "objectClass: organizationalUnit", "objectClass: top",
+        "ou: computers",
+        "description: Computers for Alex",
+        "seeAlso: ou=Machines,uid=akarasulu,ou=users,ou=system",
+        // Entry # 3
+        "dn: uid=akarasuluref,ou=users,ou=system", "objectClass: uidObject", "objectClass: referral",
+        "objectClass: top", "uid: akarasuluref", "ref: ldap://localhost:10389/uid=akarasulu,ou=users,ou=system",
+        "ref: ldap://foo:10389/uid=akarasulu,ou=users,ou=system",
+        "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" })
 public class CompareIT extends AbstractLdapTestUnit
 {
     private static final Logger LOG = LoggerFactory.getLogger( CompareIT.class );
-    
+
 
     /**
      * Tests normal compare operation on normal non-referral entries without 
@@ -107,7 +95,7 @@ public class CompareIT extends AbstractL
     public void testNormalCompare() throws Exception
     {
         LdapConnection conn = getClientApiConnection( ldapServer );
-        
+
         // comparison success
         CompareResponse resp = conn.compare( "uid=akarasulu,ou=users,ou=system", "sn", "karasulu" );
         assertEquals( ResultCodeEnum.COMPARE_TRUE, resp.getLdapResult().getResultCode() );
@@ -115,11 +103,11 @@ public class CompareIT extends AbstractL
         // comparison failure
         resp = conn.compare( "uid=akarasulu,ou=users,ou=system", "sn", "lecharny" );
         assertEquals( ResultCodeEnum.COMPARE_FALSE, resp.getLdapResult().getResultCode() );
-        
+
         conn.unBind();
     }
-    
-    
+
+
     /**
      * Tests normal compare operation on normal non-referral entries without 
      * the ManageDsaIT control using an attribute that does not exist in the
@@ -129,14 +117,14 @@ public class CompareIT extends AbstractL
     public void testNormalCompareMissingAttribute() throws Exception
     {
         LDAPConnection conn = getWiredConnection( ldapServer );
-        
+
         // comparison success
         LDAPAttribute attribute = new LDAPAttribute( "sn", "karasulu" );
         assertTrue( conn.compare( "uid=akarasulu,ou=users,ou=system", attribute ) );
 
         // non-existing attribute
         attribute = new LDAPAttribute( "mail", "akarasulu@apache.org" );
-        
+
         try
         {
             conn.compare( "uid=akarasulu,ou=users,ou=system", attribute );
@@ -144,13 +132,13 @@ public class CompareIT extends AbstractL
         }
         catch ( LDAPException e )
         {
-            assertEquals( ResultCodeEnum.NO_SUCH_ATTRIBUTE.getValue(), e.getLDAPResultCode() ); 
+            assertEquals( ResultCodeEnum.NO_SUCH_ATTRIBUTE.getValue(), e.getLDAPResultCode() );
         }
-        
+
         conn.disconnect();
     }
-    
-    
+
+
     /**
      * Tests compare operation on referral entry with the ManageDsaIT control.
      */
@@ -162,7 +150,7 @@ public class CompareIT extends AbstractL
         constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
         constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
         conn.setConstraints( constraints );
-        
+
         // comparison success
         LDAPAttribute attribute = new LDAPAttribute( "uid", "akarasuluref" );
         assertTrue( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );
@@ -170,11 +158,11 @@ public class CompareIT extends AbstractL
         // comparison failure
         attribute = new LDAPAttribute( "uid", "elecharny" );
         assertFalse( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );
-        
+
         conn.disconnect();
     }
-    
-    
+
+
     /**
      * Tests compare operation on normal and referral entries without the 
      * ManageDsaIT control. Referrals are sent back to the client with a
@@ -187,7 +175,7 @@ public class CompareIT extends AbstractL
         LDAPConstraints constraints = new LDAPConstraints();
         constraints.setReferrals( false );
         conn.setConstraints( constraints );
-        
+
         // comparison success
         LDAPAttribute attribute = new LDAPAttribute( "uid", "akarasulu" );
         assertTrue( conn.compare( "uid=akarasulu,ou=users,ou=system", attribute, constraints ) );
@@ -207,8 +195,8 @@ public class CompareIT extends AbstractL
 
         conn.disconnect();
     }
-    
-    
+
+
     /**
      * Tests compare operation on normal and referral entries without the 
      * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
@@ -221,10 +209,10 @@ public class CompareIT extends AbstractL
         SearchControls controls = new SearchControls();
         controls.setReturningAttributes( new String[0] );
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-        
+
         // comparison success
-        NamingEnumeration<SearchResult> answer = ctx.search( "uid=akarasulu,ou=users,ou=system", 
-            "(uid=akarasulu)", controls );
+        NamingEnumeration<SearchResult> answer = ctx.search( "uid=akarasulu,ou=users,ou=system", "(uid=akarasulu)",
+            controls );
         assertTrue( answer.hasMore() );
         SearchResult result = answer.next();
         assertEquals( "", result.getName() );
@@ -235,8 +223,7 @@ public class CompareIT extends AbstractL
         // referrals failure
         try
         {
-            answer = ctx.search( "uid=akarasuluref,ou=users,ou=system", 
-                "(uid=akarasuluref)", controls );
+            answer = ctx.search( "uid=akarasuluref,ou=users,ou=system", "(uid=akarasuluref)", controls );
             fail( "Should never get here" );
         }
         catch ( ReferralException e )
@@ -247,8 +234,8 @@ public class CompareIT extends AbstractL
 
         ctx.close();
     }
-    
-    
+
+
     /**
      * Check that operation are not executed if we are now allowed to bind
      * anonymous
@@ -261,7 +248,7 @@ public class CompareIT extends AbstractL
         LDAPConnection conn = new LDAPConnection();
         conn.connect( "localhost", ldapServer.getPort() );
         LDAPAttribute attr = new LDAPAttribute( "uid", "admin" );
-        
+
         try
         {
             conn.compare( "uid=admin,ou=system", attr );
@@ -272,12 +259,12 @@ public class CompareIT extends AbstractL
             assertEquals( "no permission exception", 50, e.getLDAPResultCode() );
         }
     }
-    
-    
+
+
     /**
      * Tests referral handling when an ancestor is a referral.
      */
-    @Test 
+    @Test
     public void testAncestorReferral() throws Exception
     {
         LOG.debug( "" );
@@ -295,7 +282,8 @@ public class CompareIT extends AbstractL
         response = listener.getResponse();
         assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
 
-        assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
+        assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system",
+            response.getReferrals()[0] );
         assertEquals( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
         assertEquals( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java Fri Aug 20 19:31:58 2010
@@ -39,12 +39,12 @@ import netscape.ldap.LDAPResponseListene
 import netscape.ldap.LDAPSearchConstraints;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.DeleteResponse;
 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.message.DeleteResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -57,45 +57,34 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class ) 
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" )
-    })
-@ApplyLdifs( {
-    // Entry # 1
-    "dn: uid=akarasulu,ou=users,ou=system",
-    "objectClass: uidObject",
-    "objectClass: person",
-    "objectClass: top",
-    "uid: akarasulu",
-    "cn: Alex Karasulu",
-    "sn: karasulu", 
-    
-    // Entry # 2
-    "dn: ou=Computers,uid=akarasulu,ou=users,ou=system",
-    "objectClass: organizationalUnit",
-    "objectClass: top",
-    "ou: computers",
-    "description: Computers for Alex",
-    "seeAlso: ou=Machines,uid=akarasulu,ou=users,ou=system", 
-    
-    // Entry # 3
-    "dn: uid=akarasuluref,ou=users,ou=system",
-    "objectClass: uidObject",
-    "objectClass: referral",
-    "objectClass: top",
-    "uid: akarasuluref",
-    "ref: ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", 
-    "ref: ldap://foo:10389/uid=akarasulu,ou=users,ou=system",
-    "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" 
-    }
-)
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
+@ApplyLdifs(
+    {
+        // Entry # 1
+        "dn: uid=akarasulu,ou=users,ou=system", "objectClass: uidObject", "objectClass: person",
+        "objectClass: top",
+        "uid: akarasulu",
+        "cn: Alex Karasulu",
+        "sn: karasulu",
+
+        // Entry # 2
+        "dn: ou=Computers,uid=akarasulu,ou=users,ou=system", "objectClass: organizationalUnit", "objectClass: top",
+        "ou: computers",
+        "description: Computers for Alex",
+        "seeAlso: ou=Machines,uid=akarasulu,ou=users,ou=system",
+
+        // Entry # 3
+        "dn: uid=akarasuluref,ou=users,ou=system", "objectClass: uidObject", "objectClass: referral",
+        "objectClass: top", "uid: akarasuluref", "ref: ldap://localhost:10389/uid=akarasulu,ou=users,ou=system",
+        "ref: ldap://foo:10389/uid=akarasulu,ou=users,ou=system",
+        "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" })
 public class DeleteIT extends AbstractLdapTestUnit
 {
     private static final Logger LOG = LoggerFactory.getLogger( DeleteIT.class );
 
+
     /**
      * Tests normal delete operation on normal non-referral entries without 
      * the ManageDsaIT control.
@@ -104,15 +93,15 @@ public class DeleteIT extends AbstractLd
     public void testNormalDeleteFailContextNotEmpty() throws Exception
     {
         LdapConnection conn = getClientApiConnection( ldapServer );
-        
+
         // delete failure on non-leaf entry
         DeleteResponse resp = conn.delete( "uid=akarasulu,ou=users,ou=system" );
         assertEquals( ResultCodeEnum.NOT_ALLOWED_ON_NON_LEAF, resp.getLdapResult().getResultCode() );
 
         conn.unBind();
     }
-    
-    
+
+
     /**
      * Tests normal delete operation on normal non-referral entries without 
      * the ManageDsaIT control.
@@ -121,18 +110,18 @@ public class DeleteIT extends AbstractLd
     public void testNormalDelete() throws Exception
     {
         LdapConnection conn = getClientApiConnection( ldapServer );
-        
+
         // delete success
         conn.delete( "ou=computers,uid=akarasulu,ou=users,ou=system" );
 
         // delete failure non-existant entry
         DeleteResponse resp = conn.delete( "uid=elecharny,ou=users,ou=system" );
         assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, resp.getLdapResult().getResultCode() );
-        
+
         conn.unBind();
     }
-    
-    
+
+
     /**
      * Tests normal delete operation on non-existent entries without 
      * the ManageDsaIT control.
@@ -141,15 +130,15 @@ public class DeleteIT extends AbstractLd
     public void testDeleteNonExistent() throws Exception
     {
         LdapConnection conn = getClientApiConnection( ldapServer );
-        
+
         // delete failure non-existent entry
         DeleteResponse resp = conn.delete( "uid=elecharny,ou=users,ou=system" );
         assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, resp.getLdapResult().getResultCode() );
-        
+
         conn.unBind();
     }
-    
-    
+
+
     /**
      * Tests delete operation on referral entry with the ManageDsaIT control.
      */
@@ -161,10 +150,10 @@ public class DeleteIT extends AbstractLd
         constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
         constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
         conn.setConstraints( constraints );
-        
+
         // delete success
         conn.delete( "uid=akarasuluref,ou=users,ou=system", constraints );
-        
+
         try
         {
             conn.read( "uid=akarasuluref,ou=users,ou=system", ( LDAPSearchConstraints ) constraints );
@@ -174,11 +163,11 @@ public class DeleteIT extends AbstractLd
         {
             assertEquals( ResultCodeEnum.NO_SUCH_OBJECT.getValue(), e.getLDAPResultCode() );
         }
-        
+
         conn.disconnect();
     }
-    
-    
+
+
     /**
      * Tests delete operation on normal and referral entries without the 
      * ManageDsaIT control. Referrals are sent back to the client with a
@@ -191,7 +180,7 @@ public class DeleteIT extends AbstractLd
         LDAPConstraints constraints = new LDAPConstraints();
         constraints.setReferrals( false );
         conn.setConstraints( constraints );
-        
+
         // referrals failure
         LDAPResponseListener listener = null;
         LDAPResponse response = null;
@@ -206,8 +195,8 @@ public class DeleteIT extends AbstractLd
 
         conn.disconnect();
     }
-    
-    
+
+
     /**
      * Tests delete operation on normal and referral entries without the 
      * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
@@ -217,10 +206,10 @@ public class DeleteIT extends AbstractLd
     public void testThrowOnReferralWithJndi() throws Exception
     {
         LdapContext ctx = getWiredContextThrowOnRefferal( ldapServer );
-        
+
         // delete success
         ctx.destroySubcontext( "ou=computers,uid=akarasulu,ou=users,ou=system" );
-        
+
         try
         {
             ctx.lookup( "ou=computers,uid=akarasulu,ou=users,ou=system" );
@@ -244,12 +233,12 @@ public class DeleteIT extends AbstractLd
 
         ctx.close();
     }
-    
-    
+
+
     /**
      * Tests referral handling when an ancestor is a referral.
      */
-    @Test 
+    @Test
     public void testAncestorReferral() throws Exception
     {
         LOG.debug( "" );
@@ -266,30 +255,30 @@ public class DeleteIT extends AbstractLd
         response = listener.getResponse();
         assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
 
-        assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
+        assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system",
+            response.getReferrals()[0] );
         assertEquals( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
         assertEquals( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
 
         conn.disconnect();
     }
-    
-    
+
 
     /**
      * Try to delete an entry with invalid DN. The operation fails
      * during parsing the given DN
      */
     @Test
-    public void testDeleteWithIllegalName() throws Exception 
+    public void testDeleteWithIllegalName() throws Exception
     {
         LdapConnection conn = getClientApiConnection( ldapServer );
-        
-        try 
+
+        try
         {
-            conn.delete("This is an illegal name,dc=example,dc=com" );
+            conn.delete( "This is an illegal name,dc=example,dc=com" );
             fail( "deletion should fail" );
-        } 
-        catch ( Exception e ) 
+        }
+        catch ( Exception e )
         {
             // expected
         }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java Fri Aug 20 19:31:58 2010
@@ -55,34 +55,24 @@ import org.junit.runner.RunWith;
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class ) 
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" )
-    },
-    saslHost="localhost",
-    saslMechanisms = 
-    {
-        @SaslMechanism( name=SupportedSaslMechanisms.PLAIN, implClass=PlainMechanismHandler.class ),
-        @SaslMechanism( name=SupportedSaslMechanisms.CRAM_MD5, implClass=CramMd5MechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.DIGEST_MD5, implClass=DigestMd5MechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.GSSAPI, implClass=GssapiMechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.NTLM, implClass=NtlmMechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.GSS_SPNEGO, implClass=NtlmMechanismHandler.class)
-    },
-    extendedOpHandlers = 
-    {
-        StoredProcedureExtendedOperationHandler.class
-    })
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") }, saslHost = "localhost", saslMechanisms =
+    { @SaslMechanism(name = SupportedSaslMechanisms.PLAIN, implClass = PlainMechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.CRAM_MD5, implClass = CramMd5MechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.DIGEST_MD5, implClass = DigestMd5MechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.GSSAPI, implClass = GssapiMechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.NTLM, implClass = NtlmMechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.GSS_SPNEGO, implClass = NtlmMechanismHandler.class) }, extendedOpHandlers =
+    { StoredProcedureExtendedOperationHandler.class })
 public class StoredProcedureIT extends AbstractLdapTestUnit
 {
     private LdapContext ctx;
     private LdapContext spCtx;
     private Map<String, OidNormalizer> oids;
 
-    
-    @Before 
+
+    @Before
     public void setUp() throws Exception
     {
         Hashtable<String, Object> env = new Hashtable<String, Object>();
@@ -92,13 +82,13 @@ public class StoredProcedureIT extends A
         env.put( "java.naming.security.credentials", "secret" );
         env.put( "java.naming.security.authentication", "simple" );
         ctx = new InitialLdapContext( env, null );
-        
+
         Attributes spContainer = new BasicAttributes( "objectClass", "top", true );
         spContainer.get( "objectClass" ).add( "organizationalUnit" );
         spContainer.put( "ou", "Stored Procedures" );
         spCtx = ( LdapContext ) ctx.createSubcontext( "ou=Stored Procedures", spContainer );
         assertNotNull( spCtx );
-        
+
         // Initialize OIDs maps for normalization
         oids = new HashMap<String, OidNormalizer>();
 
@@ -107,27 +97,28 @@ public class StoredProcedureIT extends A
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
     }
 
-    
+
     @Test
     public void testExecuteProcedureWithReturnValue() throws Exception
     {
         String procedureName = HelloWorldProcedure.class.getName() + ":sayHello";
         JavaStoredProcUtils.loadStoredProcedureClass( spCtx, HelloWorldProcedure.class );
-        Object response = JavaStoredProcUtils.callStoredProcedure( ctx, procedureName, new Object[] { } );
+        Object response = JavaStoredProcUtils.callStoredProcedure( ctx, procedureName, new Object[]
+            {} );
         assertEquals( "Hello World!", response );
     }
-    
+
 
     @Test
     public void testExecuteProcedureWithParametersAndReturnValue() throws Exception
     {
         String procedureName = HelloWorldProcedure.class.getName() + ":sayHelloTo";
         JavaStoredProcUtils.loadStoredProcedureClass( spCtx, HelloWorldProcedure.class );
-        Object response = JavaStoredProcUtils.callStoredProcedure( ctx, procedureName, new Object[] { "Ersin" } );
+        Object response = JavaStoredProcUtils.callStoredProcedure( ctx, procedureName, new Object[]
+            { "Ersin" } );
         assertEquals( "Hello Ersin!", response );
     }
-    
-    
+
     /*
     @Test public void testSPDeleteSubtree() throws Exception
     {

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java Fri Aug 20 19:31:58 2010
@@ -32,8 +32,6 @@ import javax.naming.ldap.InitialLdapCont
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.constants.ServerDNConstants;
@@ -42,6 +40,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.Response;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -53,15 +53,13 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer(
-    transports =
-      { 
-        @CreateTransport(protocol = "LDAP") 
-      })
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
 public class LookupPerfIT extends AbstractLdapTestUnit
 {
     public static LdapServer ldapServer;
 
+
     /**
      * Evaluate the lookup operation performances
      */
@@ -70,37 +68,37 @@ public class LookupPerfIT extends Abstra
     {
         LdapConnection connection = getClientApiConnection( ldapServer );
 
-        SearchResponse response = connection.lookup( "uid=admin,ou=system" );;
+        Response response = connection.lookup( "uid=admin,ou=system" );;
         assertNotNull( response );
         assertTrue( response instanceof SearchResultEntry );
-        
-        SearchResultEntry result = (SearchResultEntry)response;
+
+        SearchResultEntry result = ( SearchResultEntry ) response;
 
         assertNotNull( result );
-        
+
         Entry entry = result.getEntry();
-        
+
         assertNotNull( entry );
 
         long t0 = System.currentTimeMillis();
-        
+
         for ( int i = 0; i < 50; i++ )
         {
-            for ( int j = 0; j < 10000; j++)
+            for ( int j = 0; j < 10000; j++ )
             {
                 response = connection.lookup( "uid=admin,ou=system", "+" );
             }
-            
+
             System.out.print( "." );
         }
-        
+
         long t1 = System.currentTimeMillis();
-        
+
         System.out.println( "Delta : " + ( t1 - t0 ) );
         connection.close();
     }
-    
-    
+
+
     public static LdapContext getWiredContext( LdapServer ldapServer, Control[] controls ) throws Exception
     {
         Hashtable<String, String> env = new Hashtable<String, String>();
@@ -109,11 +107,11 @@ public class LookupPerfIT extends Abstra
         env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
-        
+
         return new InitialLdapContext( env, JndiUtils.toJndiControls( controls ) );
     }
 
-    
+
     /**
      * Evaluate the lookup operation performances
      */
@@ -121,27 +119,27 @@ public class LookupPerfIT extends Abstra
     public void testLookupPerfJNDI() throws Exception
     {
         LdapContext ctx = getWiredContext( ldapServer, null );
-        
+
         Attributes result = ctx.getAttributes( "uid=admin,ou=system" );
-        
+
         assertNotNull( result );
 
         long t0 = System.currentTimeMillis();
-        
+
         for ( int i = 0; i < 50; i++ )
         {
-            for ( int j = 0; j < 10000; j++)
+            for ( int j = 0; j < 10000; j++ )
             {
                 ctx.getAttributes( "uid=admin,ou=system" );
             }
-            
+
             System.out.print( "." );
         }
-        
+
         long t1 = System.currentTimeMillis();
-        
+
         System.out.println( "Delta : " + ( t1 - t0 ) );
-        
+
         ctx.close();
     }
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java Fri Aug 20 19:31:58 2010
@@ -31,16 +31,17 @@ 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.ldap.client.api.message.ModifyResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 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.ModifyRequest;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
+import org.apache.directory.shared.ldap.message.ModifyResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -66,43 +67,37 @@ import org.junit.runner.RunWith;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class ) 
+@RunWith(FrameworkRunner.class)
 //@CreateDS( name="IllegalModificationIT-class", enableChangeLog=false )
-@CreateLdapServer ( 
-    transports = 
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
+@ApplyLdifs(
     {
-        @CreateTransport( protocol = "LDAP" )
-    })
-@ApplyLdifs( {
     // Entry # 1
-    "dn: cn=Kate Bush,ou=system",
-    "objectClass: person",
-    "objectClass: top",
-    "cn: Kate Bush",
-    "sn: Bush" 
-    }
-)
+        "dn: cn=Kate Bush,ou=system", "objectClass: person", "objectClass: top", "cn: Kate Bush", "sn: Bush" })
 public class IllegalModificationIT extends AbstractLdapTestUnit
 {
     private static final String DN = "cn=Kate Bush,ou=system";
 
+
     @Test
     public void testIllegalModification() throws Exception
     {
         LdapConnection con = getClientApiConnection( ldapServer );
 
-        ModifyRequest modReq = new ModifyRequest( new DN( DN ) );
+        ModifyRequest modReq = new ModifyRequestImpl();
+        modReq.setName( new DN( DN ) );
         modReq.add( "description", "" );
 
         ModifyResponse resp = con.modify( modReq );
         assertEquals( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, resp.getLdapResult().getResultCode() );
 
         // Check whether entry is unmodified, i.e. no description
-        Entry entry = ( ( SearchResultEntry )con.lookup( DN ) ).getEntry();
+        Entry entry = ( ( SearchResultEntry ) con.lookup( DN ) ).getEntry();
         assertEquals( "description exists?", null, entry.get( "description" ) );
     }
-    
-    
+
+
     @Test
     public void testIllegalModification2() throws Exception
     {
@@ -117,7 +112,8 @@ public class IllegalModificationIT exten
 
         try
         {
-            con.modify( "cn=Kate Bush,ou=system", new LDAPModification[] { mod, mod2 } );
+            con.modify( "cn=Kate Bush,ou=system", new LDAPModification[]
+                { mod, mod2 } );
             fail( "error expected due to empty attribute value" );
         }
         catch ( LDAPException e )

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java Fri Aug 20 19:31:58 2010
@@ -32,12 +32,12 @@ 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.ModifyDnResponse;
 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.message.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java Fri Aug 20 19:31:58 2010
@@ -48,8 +48,6 @@ import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
-import org.apache.directory.ldap.client.api.message.SearchRequest;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
@@ -64,6 +62,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.Response;
+import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.Ignore;
@@ -79,11 +80,8 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer(
-    transports =
-      { 
-        @CreateTransport(protocol = "LDAP") 
-      })
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifs(
     {
 
@@ -1603,7 +1601,7 @@ public class SearchIT extends AbstractLd
             }
 
             // Searches for all the entries in ou=system
-            Cursor<SearchResponse> cursor = asyncCnx.search( "ou=system", "(ObjectClass=*)", SearchScope.SUBTREE, "*" );
+            Cursor<Response> cursor = asyncCnx.search( "ou=system", "(ObjectClass=*)", SearchScope.SUBTREE, "*" );
 
             // Now loop on all the elements found, and abandon after 10 elements returned
             int count = 0;
@@ -1656,15 +1654,15 @@ public class SearchIT extends AbstractLd
     {
         long sizeLimit = 7;
         LdapConnection connection = getClientApiConnection( ldapServer );
-        SearchRequest req = new SearchRequest();
-        req.setBaseDn( "ou=system" );
+        SearchRequest req = new SearchRequestImpl();
+        req.setBase( new DN( "ou=system" ) );
         req.setFilter( "(ou=*)" );
         req.setScope( SearchScope.SUBTREE );
         req.setSizeLimit( sizeLimit );
 
-        Cursor<SearchResponse> cursor = connection.search( req );
+        Cursor<Response> cursor = connection.search( req );
         long i = 0;
-        
+
         while ( cursor.next() )
         {
             ++i;
@@ -1675,29 +1673,29 @@ public class SearchIT extends AbstractLd
 
 
     @Test
-    @Ignore( "This test is failing because of the timing issue. Note that the SearchHandler handles time based searches correctly, this is just the below test's problem" )
+    @Ignore("This test is failing because of the timing issue. Note that the SearchHandler handles time based searches correctly, this is just the below test's problem")
     public void testSearchTimeLimit() throws Exception, InterruptedException
     {
         LdapConnection connection = getClientApiConnection( ldapServer );
-        SearchRequest req = new SearchRequest();
-        req.setBaseDn( "ou=schema" );
+        SearchRequest req = new SearchRequestImpl();
+        req.setBase( new DN( "ou=schema" ) );
         req.setFilter( "(objectClass=*)" );
         req.setScope( SearchScope.SUBTREE );
 
-        Cursor<SearchResponse> cursor = connection.search( req );
+        Cursor<Response> cursor = connection.search( req );
         int count = 0;
-        
+
         while ( cursor.next() )
         {
             ++count;
         }
-        
+
         cursor.close();
 
         req.setTimeLimit( 1 );
         cursor = connection.search( req );
         int newCount = 0;
-        
+
         while ( cursor.next() )
         {
             ++newCount;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java Fri Aug 20 19:31:58 2010
@@ -25,7 +25,6 @@ import static org.junit.Assert.fail;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -34,6 +33,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.Response;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -46,15 +46,13 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer(
-    transports =
-      { 
-        @CreateTransport(protocol = "LDAP") 
-      })
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
 public class SearchPerfIT extends AbstractLdapTestUnit
 {
     public static LdapServer ldapServer;
 
+
     /**
      * test a search request perf.
      */
@@ -73,23 +71,26 @@ public class SearchPerfIT extends Abstra
             connection.bind( "uid=admin,ou=system", "secret" );
 
             // Searches for all the entries in ou=system
-            Cursor<SearchResponse> cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)", SearchScope.OBJECT, "*" );
-            
+            Cursor<Response> cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)",
+                SearchScope.OBJECT, "*" );
+
             int i = 0;
-            
+
             while ( cursor.next() )
             {
                 cursor.get();
                 ++i;
             }
-            
+
             cursor.close();
             assertEquals( 1, i );
 
             for ( int j = 0; j < 10000; j++ )
             {
                 cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)", SearchScope.OBJECT, "*" );
-                while ( cursor.next() ){}
+                while ( cursor.next() )
+                {
+                }
                 cursor.close();
             }
 
@@ -100,18 +101,21 @@ public class SearchPerfIT extends Abstra
             {
                 if ( j % 10000 == 0 )
                 {
-                    System.out.println(j);
+                    System.out.println( j );
                 }
 
                 cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)", SearchScope.OBJECT, "*" );
-                while ( cursor.next() ){}
+                while ( cursor.next() )
+                {
+                }
                 cursor.close();
             }
-            
+
             long t1 = System.currentTimeMillis();
-            
+
             Long deltaWarmed = ( t1 - t0 );
-            System.out.println( "Delta : " + deltaWarmed + "( " + ( ( nbIterations * 1000 ) / deltaWarmed ) + " per s ) /" + ( t1 - t0 ) );
+            System.out.println( "Delta : " + deltaWarmed + "( " + ( ( nbIterations * 1000 ) / deltaWarmed )
+                + " per s ) /" + ( t1 - t0 ) );
         }
         catch ( LdapException e )
         {

Propchange: directory/apacheds/trunk/server-jndi/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/server-jndi:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-jndi:980138-980937
-/directory/apacheds/trunk/server-jndi:980025-980137

Propchange: directory/apacheds/trunk/server-replication/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/server-replication:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-replication:980138-980937
-/directory/apacheds/trunk/server-replication:980025-980137

Propchange: directory/apacheds/trunk/server-tools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/server-tools:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-tools:980138-980937
-/directory/apacheds/trunk/server-tools:980025-980137

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java (original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java Fri Aug 20 19:31:58 2010
@@ -33,7 +33,7 @@ import javax.swing.JButton;
 
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.ldap.LdapSession;
-import org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest;
+import org.apache.directory.shared.ldap.message.AbandonableRequest;
 
 import javax.swing.JTextArea;
 import javax.swing.event.ListSelectionEvent;
@@ -43,7 +43,7 @@ import javax.swing.event.ListSelectionLi
 public class OutstandingRequestsDialog extends JDialog
 {
     private static final long serialVersionUID = -3777123348215825711L;
-    private static final InternalAbandonableRequest[] EMPTY_REQUEST_ARRAY = new InternalAbandonableRequest[0];
+    private static final AbandonableRequest[] EMPTY_REQUEST_ARRAY = new AbandonableRequest[0];
     private JPanel jContentPane;
     private JPanel jPanel;
     private JScrollPane jScrollPane;
@@ -165,7 +165,7 @@ public class OutstandingRequestsDialog e
                 if ( row > -1 )
                 {
                     jButton2.setEnabled( true );
-                    InternalAbandonableRequest req = ( ( OutstandingRequestsModel ) jTable.getModel() )
+                    AbandonableRequest req = ( ( OutstandingRequestsModel ) jTable.getModel() )
                         .getAbandonableRequest( row );
                     jTextArea.setText( req.toString() );
                     jTextArea.setEnabled( true );
@@ -184,14 +184,14 @@ public class OutstandingRequestsDialog e
 
     private void setRequestsModel()
     {
-        InternalAbandonableRequest[] requests;
-        Map<Integer, InternalAbandonableRequest> reqsMap = session.getOutstandingRequests();
+        AbandonableRequest[] requests;
+        Map<Integer, AbandonableRequest> reqsMap = session.getOutstandingRequests();
         
         if ( reqsMap != null )
         {
-            requests = new InternalAbandonableRequest[reqsMap.size()];
+            requests = new AbandonableRequest[reqsMap.size()];
             //noinspection unchecked
-            requests = (org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest[] ) reqsMap.values().toArray( requests );
+            requests = (org.apache.directory.shared.ldap.message.AbandonableRequest[] ) reqsMap.values().toArray( requests );
         }
         else
         {
@@ -325,7 +325,7 @@ public class OutstandingRequestsDialog e
                 public void actionPerformed( java.awt.event.ActionEvent e )
                 {
                     int row = jTable.getSelectedRow();
-                    InternalAbandonableRequest req = ( ( OutstandingRequestsModel ) jTable.getModel() )
+                    AbandonableRequest req = ( ( OutstandingRequestsModel ) jTable.getModel() )
                         .getAbandonableRequest( row );
                     req.abandon();
                     session.abandonOutstandingRequest( req.getMessageId() );

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsModel.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsModel.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsModel.java (original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsModel.java Fri Aug 20 19:31:58 2010
@@ -24,7 +24,7 @@ import javax.swing.event.TableModelListe
 import javax.swing.table.TableModel;
 
 import org.apache.directory.server.i18n.I18n;
-import org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest;
+import org.apache.directory.shared.ldap.message.AbandonableRequest;
 
 
 public class OutstandingRequestsModel implements TableModel
@@ -33,16 +33,16 @@ public class OutstandingRequestsModel im
         { "messageId", "type" };
     final Class<?>[] columnClasses = new Class[]
         { Integer.class, String.class };
-    final InternalAbandonableRequest[] requests;
+    final AbandonableRequest[] requests;
 
 
-    OutstandingRequestsModel(InternalAbandonableRequest[] requests)
+    OutstandingRequestsModel(AbandonableRequest[] requests)
     {
         this.requests = requests;
     }
 
 
-    InternalAbandonableRequest getAbandonableRequest( int row )
+    AbandonableRequest getAbandonableRequest( int row )
     {
         return requests[row];
     }
@@ -80,7 +80,7 @@ public class OutstandingRequestsModel im
 
     public Object getValueAt( int rowIndex, int columnIndex )
     {
-        InternalAbandonableRequest req = requests[rowIndex];
+        AbandonableRequest req = requests[rowIndex];
 
         switch ( columnIndex )
         {

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java (original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java Fri Aug 20 19:31:58 2010
@@ -41,10 +41,10 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.gui.SessionsFrame;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.extended.LaunchDiagnosticUiRequest;
 import org.apache.directory.shared.ldap.message.extended.LaunchDiagnosticUiResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -76,7 +76,7 @@ public class LaunchDiagnosticUiHandler i
 
     // This will suppress PMD.EmptyCatchBlock warnings in this method
     @SuppressWarnings("PMD.EmptyCatchBlock")
-    public void handleExtendedOperation( LdapSession requestor, InternalExtendedRequest req )
+    public void handleExtendedOperation( LdapSession requestor, ExtendedRequest req )
         throws Exception
     {
         DirectoryService service = requestor.getCoreSession().getDirectoryService();

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java (original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java Fri Aug 20 19:31:58 2010
@@ -21,6 +21,7 @@ package org.apache.directory.server.tool
 
 
 import java.util.Hashtable;
+
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
@@ -30,6 +31,7 @@ import org.apache.commons.cli.Options;
 import org.apache.directory.daemon.AvailablePortFinder;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.message.extended.LaunchDiagnosticUiRequest;
+import org.apache.directory.shared.ldap.util.JndiUtils;
 
 
 /**
@@ -81,7 +83,7 @@ public class DiagnosticCommand extends T
         {
             System.out.println( "Connection to the server established.\n" + "Sending extended request ... " );
         }
-        ctx.extendedOperation( new LaunchDiagnosticUiRequest( 3 ) );
+        ctx.extendedOperation( JndiUtils.toJndiExtendedRequest( new LaunchDiagnosticUiRequest( 3 ) ) );
         ctx.close();
     }
 

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java (original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java Fri Aug 20 19:31:58 2010
@@ -32,6 +32,7 @@ import org.apache.commons.cli.Options;
 import org.apache.directory.daemon.AvailablePortFinder;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownRequest;
+import org.apache.directory.shared.ldap.util.JndiUtils;
 
 
 /**
@@ -101,7 +102,8 @@ public class GracefulShutdownCommand ext
         }
         try
         {
-            ctx.extendedOperation( new GracefulShutdownRequest( 0, timeOffline, delay ) );
+            ctx.extendedOperation( JndiUtils
+                .toJndiExtendedRequest( new GracefulShutdownRequest( 0, timeOffline, delay ) ) );
             isSuccess = true;
         }
         catch ( Throwable t )

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java (original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java Fri Aug 20 19:31:58 2010
@@ -35,36 +35,12 @@ import org.apache.directory.daemon.Avail
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
-import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 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.bind.BindRequestCodec;
-import org.apache.directory.shared.ldap.codec.bind.BindResponseCodec;
-import org.apache.directory.shared.ldap.codec.bind.LdapAuthentication;
-import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
-import org.apache.directory.shared.ldap.codec.del.DelRequestCodec;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedResponseCodec;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec;
-import org.apache.directory.shared.ldap.codec.unbind.UnBindRequestCodec;
-import org.apache.directory.shared.ldap.entry.Entry;
-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.exception.LdapException;
-import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-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.ResultCodeEnum;
-import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.name.RDN;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.ldap.message.LdapProtocolEncoder;
+import org.apache.directory.shared.ldap.message.UnbindRequest;
+import org.apache.directory.shared.ldap.message.UnbindRequestImpl;
 
 
 /**
@@ -144,9 +120,9 @@ public class ImportCommand extends ToolC
     }
 
 
+    /*
     private LdapMessageCodec readResponse( ByteBuffer bb ) throws IOException, DecoderException
     {
-
         LdapMessageCodec messageResp = null;
 
         while ( true )
@@ -166,28 +142,30 @@ public class ImportCommand extends ToolC
 
                 if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
                 {
-                    messageResp = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+                    Message message = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalMessage();
 
-                    if ( messageResp instanceof BindResponseCodec )
+                    if ( message instanceof BindResponse )
                     {
-                        BindResponseCodec resp = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
+                        BindResponse resp = ( BindResponse ) message;
 
                         if ( resp.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS )
                         {
                             System.out.println( "Error : " + resp.getLdapResult().getErrorMessage() );
                         }
                     }
-                    else if ( messageResp instanceof ExtendedResponseCodec )
+                    else if ( message instanceof ExtendedResponse )
                     {
-                        ExtendedResponseCodec resp = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
+                        ExtendedResponse response = ( ( LdapMessageContainer ) ldapMessageContainer )
+                            .getExtendedResponse();
 
-                        if ( resp.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS )
+                        if ( response.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS )
                         {
-                            System.out.println( "Error : " + resp.getLdapResult().getErrorMessage() );
+                            System.out.println( "Error : " + response.getLdapResult().getErrorMessage() );
                         }
                     }
 
                     ( ( LdapMessageContainer ) ldapMessageContainer ).clean();
+
                     break;
                 }
                 else
@@ -198,7 +176,6 @@ public class ImportCommand extends ToolC
         }
 
         return messageResp;
-
     }
 
 
@@ -206,15 +183,13 @@ public class ImportCommand extends ToolC
      * Send the entry to the encoder, then wait for a
      * reponse from the LDAP server on the results of the operation.
      * 
-     * @param ldifEntry
-     *            The entry to add
-     * @param msgId
-     *            message id number
-     */
+     * @param ldifEntry The entry to add
+     * @param msgId message id number
+     *
     private int addEntry( LdifEntry ldifEntry, int messageId ) throws IOException, DecoderException, LdapException,
         EncoderException
     {
-        AddRequestCodec addRequest = new AddRequestCodec();
+        AddRequest addRequest = new AddRequestImpl();
 
         String dn = ldifEntry.getDn().getName();
 
@@ -228,11 +203,11 @@ public class ImportCommand extends ToolC
         addRequest.setEntryDn( new DN( dn ) );
 
         // Copy the attributes
-        for ( EntryAttribute attribute:entry )
+        for ( EntryAttribute attribute : entry )
         {
             addRequest.addAttributeType( attribute.getId() );
 
-            for ( Value<?> value: attribute )
+            for ( Value<?> value : attribute )
             {
                 addRequest.addAttributeValue( value );
             }
@@ -241,7 +216,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 );
@@ -251,7 +227,7 @@ public class ImportCommand extends ToolC
         // Get the response
         LdapMessageCodec response = readResponse( bb );
 
-        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();
+        LdapResultCodec result = ( ( LdapResponseCodec ) response ).getLdapResult();
 
         if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
         {
@@ -279,11 +255,12 @@ public class ImportCommand extends ToolC
      *            The entry to delete
      * @param msgId
      *            message id number
-     */
+     *
     private int deleteEntry( LdifEntry entry, int messageId ) throws IOException, DecoderException,
         LdapInvalidDnException, EncoderException
     {
-        DelRequestCodec delRequest = new DelRequestCodec();
+        LdapProtocolEncoder encoder = new LdapProtocolEncoder();
+        DeleteRequest delRequest = new DeleteRequestImpl( messageId );
 
         String dn = entry.getDn().getName();
 
@@ -292,12 +269,10 @@ public class ImportCommand extends ToolC
             System.out.println( "Deleting entry " + dn );
         }
 
-        delRequest.setEntry( new DN( dn ) );
-
-        delRequest.setMessageId( messageId );
+        delRequest.setName( new DN( dn ) );
 
         // Encode and send the delete request
-        ByteBuffer bb = delRequest.encode();
+        ByteBuffer bb = encoder.encodeMessage( delRequest );
         bb.flip();
 
         sendMessage( bb );
@@ -307,7 +282,7 @@ public class ImportCommand extends ToolC
         // Get the response
         LdapMessageCodec response = readResponse( bb );
 
-        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();
+        LdapResultCodec result = ( ( LdapResponseCodec ) response ).getLdapResult();
 
         if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
         {
@@ -334,11 +309,11 @@ public class ImportCommand extends ToolC
      *            The entry to modify
      * @param msgId
      *            message id number
-     */
+     *
     private int changeModRDNEntry( LdifEntry entry, int messageId ) throws IOException, DecoderException,
         LdapInvalidDnException, EncoderException
     {
-        ModifyDNRequestCodec modifyDNRequest = new ModifyDNRequestCodec();
+        ModifyDnRequest modifyDNRequest = new ModifyDnRequestImpl();
 
         String dn = entry.getDn().getName();
 
@@ -347,9 +322,9 @@ public class ImportCommand extends ToolC
             System.out.println( "Modify DN of entry " + dn );
         }
 
-        modifyDNRequest.setEntry( new DN( dn ) );
-        modifyDNRequest.setDeleteOldRDN( entry.isDeleteOldRdn() );
-        modifyDNRequest.setNewRDN( new RDN( entry.getNewRdn() ) );
+        modifyDNRequest.setName( new DN( dn ) );
+        modifyDNRequest.setDeleteOldRdn( entry.isDeleteOldRdn() );
+        modifyDNRequest.setNewRdn( new RDN( entry.getNewRdn() ) );
 
         if ( StringTools.isEmpty( entry.getNewSuperior() ) == false )
         {
@@ -358,8 +333,10 @@ public class ImportCommand extends ToolC
 
         modifyDNRequest.setMessageId( messageId );
 
-        // Encode and send the delete request
-        ByteBuffer bb = modifyDNRequest.encode();
+        // Encode and send the modifyDn request
+        LdapProtocolEncoder encoder = new LdapProtocolEncoder();
+
+        ByteBuffer bb = encoder.encodeMessage( modifyDNRequest );
         bb.flip();
 
         sendMessage( bb );
@@ -369,7 +346,7 @@ public class ImportCommand extends ToolC
         // Get the response
         LdapMessageCodec response = readResponse( bb );
 
-        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();
+        LdapResultCodec result = ( ( LdapResponseCodec ) response ).getLdapResult();
 
         if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
         {
@@ -394,11 +371,11 @@ public class ImportCommand extends ToolC
      * 
      * @param entry The entry to modify
      * @param msgId message id number
-     */
+     *
     private int changeModifyEntry( LdifEntry entry, int messageId ) throws IOException, DecoderException,
-         LdapInvalidDnException, EncoderException
+        LdapInvalidDnException, EncoderException
     {
-        ModifyRequestCodec modifyRequest = new ModifyRequestCodec();
+        ModifyRequest modifyRequest = new ModifyRequestImpl();
 
         String dn = entry.getDn().getName();
 
@@ -407,24 +384,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() )
+        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 );
@@ -434,7 +406,7 @@ public class ImportCommand extends ToolC
         // Get the response
         LdapMessageCodec response = readResponse( bb );
 
-        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();
+        LdapResultCodec result = ( ( LdapResponseCodec ) response ).getLdapResult();
 
         if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
         {
@@ -461,9 +433,9 @@ public class ImportCommand extends ToolC
      *            The entry to add
      * @param msgId
      *            message id number
-     */
-    private int changeEntry( LdifEntry entry, int messageId ) throws IOException, DecoderException,
-        LdapException, EncoderException
+     *
+    private int changeEntry( LdifEntry entry, int messageId ) throws IOException, DecoderException, LdapException,
+        EncoderException
     {
         switch ( entry.getChangeType().getChangeType() )
         {
@@ -491,26 +463,23 @@ public class ImportCommand extends ToolC
      * Bind to the ldap server
      * 
      * @param messageId The message Id
-     */
+     *
     private void bind( int messageId ) throws LdapInvalidDnException, EncoderException, DecoderException, IOException
     {
-        BindRequestCodec bindRequest = new BindRequestCodec();
-        LdapAuthentication authentication = null;
+        BindRequest bindRequest = new BindRequestImpl( messageId );
 
         if ( "simple".equals( auth ) )
         {
-            authentication = new SimpleAuthentication();
-            ( ( SimpleAuthentication ) authentication ).setSimple( StringTools.getBytesUtf8( password ) );
+            bindRequest.setCredentials( StringTools.getBytesUtf8( password ) );
+            bindRequest.setSimple( true );
         }
 
-        bindRequest.setAuthentication( authentication );
         bindRequest.setName( new DN( user ) );
-        bindRequest.setVersion( 3 );
-
-        bindRequest.setMessageId( messageId );
 
         // Encode and send the bind request
-        ByteBuffer bb = bindRequest.encode();
+        LdapProtocolEncoder encoder = new LdapProtocolEncoder();
+
+        ByteBuffer bb = encoder.encodeMessage( bindRequest );
         bb.flip();
 
         connect();
@@ -521,7 +490,7 @@ public class ImportCommand extends ToolC
         // Get the bind response
         LdapMessageCodec response = readResponse( bb );
 
-        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();
+        LdapResultCodec result = ( ( LdapResponseCodec ) response ).getLdapResult();
 
         if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
         {
@@ -549,10 +518,10 @@ public class ImportCommand extends ToolC
      */
     private void unbind( int messageId ) throws EncoderException, DecoderException, IOException
     {
-        UnBindRequestCodec unbindRequest = new UnBindRequestCodec();
+        UnbindRequest unbindRequest = new UnbindRequestImpl( messageId );
+        LdapProtocolEncoder encoder = new LdapProtocolEncoder();
 
-        unbindRequest.setMessageId( messageId );
-        ByteBuffer bb = unbindRequest.encode();
+        ByteBuffer bb = encoder.encodeMessage( unbindRequest );
         bb.flip();
 
         sendMessage( bb );
@@ -572,6 +541,11 @@ public class ImportCommand extends ToolC
      */
     public void execute( CommandLine cmd ) throws Exception
     {
+        return;
+    }
+
+
+    /*
         processOptions( cmd );
 
         if ( isDebugEnabled() )
@@ -603,13 +577,13 @@ public class ImportCommand extends ToolC
             long t0 = System.currentTimeMillis();
             int nbAdd = 0;
 
-            for ( LdifEntry entry:ldifReader )
+            for ( LdifEntry entry : ldifReader )
             {
                 // Check if we have had some error, has next() does not throw any exception
                 if ( ldifReader.hasError() )
                 {
-                    System.err
-                        .println( "Found an error while persing an entry : " + ldifReader.getError().getLocalizedMessage() );
+                    System.err.println( "Found an error while persing an entry : "
+                        + ldifReader.getError().getLocalizedMessage() );
 
                     if ( ignoreErrors == false )
                     {
@@ -652,13 +626,13 @@ public class ImportCommand extends ToolC
             long t0 = System.currentTimeMillis();
             int nbMod = 0;
 
-            for ( LdifEntry entry:ldifReader )
+            for ( LdifEntry entry : ldifReader )
             {
                 // Check if we have had some error, has next() does not throw any exception
                 if ( ldifReader.hasError() )
                 {
-                    System.err
-                        .println( "Found an error while persing an entry : " + ldifReader.getError().getLocalizedMessage() );
+                    System.err.println( "Found an error while persing an entry : "
+                        + ldifReader.getError().getLocalizedMessage() );
 
                     if ( ignoreErrors == false )
                     {
@@ -695,7 +669,7 @@ public class ImportCommand extends ToolC
             System.out.println( "Done!" );
             System.out.println( nbMod + " entries changed in " + ( ( t1 - t0 ) / 1000 ) + " seconds" );
         }
-        
+
         ldifReader.close();
 
         // Logout to the server

Propchange: directory/apacheds/trunk/test-framework/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,7 +1,7 @@
+/directory/apacheds/branches/apacheds-codec-merge/test-framework:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/test-framework:980138-980938
 /directory/apacheds/branches/apacheds-replication/apacheds-test-framework:749790-764110
 /directory/apacheds/branches/apacheds-replication/test-framework:749790-764110
-/directory/apacheds/branches/apacheds-schema/test-framework:806623-896441
+/directory/apacheds/branches/apacheds-schema/test-framework:806623-893782
 /directory/apacheds/branches/apacheds-subtree/test-framework:965203-965686
 /directory/apacheds/branches/xdbm-refactoring/test-framework:945827-946347
-/directory/apacheds/trunk/test-framework:980025-980137

Propchange: directory/apacheds/trunk/xdbm-partition/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/xdbm-partition:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition:980138-980938
-/directory/apacheds/trunk/xdbm-partition:980025-980137

Propchange: directory/apacheds/trunk/xdbm-tools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/xdbm-tools:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-tools:980138-980938
-/directory/apacheds/trunk/xdbm-tools:980025-980137



Mime
View raw message