directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r901452 [2/2] - in /directory: apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ apacheds/trunk/core-api/src...
Date Thu, 21 Jan 2010 00:10:51 GMT
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Thu Jan 21 00:10:47 2010
@@ -89,7 +89,7 @@
 import org.apache.directory.shared.ldap.message.control.CascadeControl;
 import org.apache.directory.shared.ldap.name.AVA;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
@@ -1107,7 +1107,7 @@
     public void rename( NextInterceptor next, RenameOperationContext opContext ) throws Exception
     {
         LdapDN oldDn = opContext.getDn();
-        Rdn newRdn = opContext.getNewRdn();
+        RDN newRdn = opContext.getNewRdn();
         boolean deleteOldRn = opContext.getDelOldDn();
         ServerEntry entry =  (ServerEntry)opContext.getEntry().getClonedEntry();
 
@@ -1120,7 +1120,7 @@
         if ( deleteOldRn )
         {
             ServerEntry tmpEntry = ( ServerEntry ) entry.clone();
-            Rdn oldRDN = oldDn.getRdn();
+            RDN oldRDN = oldDn.getRdn();
 
             // Delete the old RDN means we remove some attributes and values.
             // We must make sure that after this operation all must attributes
@@ -1742,7 +1742,7 @@
             throw new NamingException( "At least two name components are expected for the dn" );
         }
         
-        Rdn rdn = dn.getRdn( 1 );
+        RDN rdn = dn.getRdn( 1 );
         return ( String ) rdn.getNormValue();
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Thu Jan 21 00:10:47 2010
@@ -20,20 +20,21 @@
 package org.apache.directory.server.core.trigger;
 
 
+import java.util.Map;
+
+import javax.naming.NamingException;
+
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
-import javax.naming.NamingException;
-import java.util.Map;
-
 
 public class ModifyDNStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
     private boolean deleteOldRn;
     private LdapDN oldRDN;
-    private Rdn newRDN;
+    private RDN newRDN;
     private LdapDN oldSuperiorDN;
     private LdapDN newSuperiorDN;
     private LdapDN oldDN;
@@ -41,7 +42,7 @@
 
 
     public ModifyDNStoredProcedureParameterInjector( OperationContext opContext, boolean deleteOldRn,
-        LdapDN oldRDN, Rdn newRDN, LdapDN oldSuperiorDN, LdapDN newSuperiorDN, LdapDN oldDN, LdapDN newDN)
+        LdapDN oldRDN, RDN newRDN, LdapDN oldSuperiorDN, LdapDN newSuperiorDN, LdapDN oldDN, LdapDN newDN)
     {
         super( opContext );
         this.deleteOldRn = deleteOldRn;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Thu Jan 21 00:10:47 2010
@@ -52,7 +52,7 @@
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
@@ -357,7 +357,7 @@
     public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws Exception
     {
         LdapDN name = renameContext.getDn();
-        Rdn newRdn = renameContext.getNewRdn();
+        RDN newRdn = renameContext.getNewRdn();
         boolean deleteOldRn = renameContext.getDelOldDn();
         
         // Bypass trigger handling if the service is disabled.
@@ -404,7 +404,7 @@
     {
         LdapDN oriChildName = opContext.getDn();
         LdapDN parent = opContext.getParent();
-        Rdn newRdn = opContext.getNewRdn();
+        RDN newRdn = opContext.getNewRdn();
         boolean deleteOldRn = opContext.getDelOldDn();
 
         // Bypass trigger handling if the service is disabled.
@@ -492,7 +492,7 @@
         ClonedServerEntry movedEntry = opContext.lookup( oriChildName, ByPassConstants.LOOKUP_BYPASS );
         
         LdapDN oldRDN = new LdapDN( oriChildName.getRdn().getUpName() );
-        Rdn newRDN = new Rdn( oriChildName.getRdn().getUpName() );
+        RDN newRDN = new RDN( oriChildName.getRdn().getUpName() );
         LdapDN oldSuperiorDN = ( LdapDN ) oriChildName.clone();
         oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
         LdapDN newSuperiorDN = ( LdapDN ) newParentName.clone();

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java Thu Jan 21 00:10:47 2010
@@ -58,7 +58,7 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.AVA;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -1733,22 +1733,22 @@
 
     /**
      * Changes the relative distinguished name of an entry specified by a 
-     * distinguished name with the optional removal of the old Rdn attribute
+     * distinguished name with the optional removal of the old RDN attribute
      * value from the entry.  Name changes propagate down as dn changes to the 
-     * descendants of the entry where the Rdn changed. 
+     * descendants of the entry where the RDN changed. 
      * 
-     * An Rdn change operation does not change parent child relationships.  It 
-     * merely propagates a name change at a point in the DIT where the Rdn is 
+     * An RDN change operation does not change parent child relationships.  It 
+     * merely propagates a name change at a point in the DIT where the RDN is 
      * changed. The change propagates down the subtree rooted at the 
      * distinguished name specified.
      *
      * @param dn the normalized distinguished name of the entry to alter
-     * @param newRdn the new Rdn to set
-     * @param deleteOldRdn whether or not to remove the old Rdn attr/val
+     * @param newRdn the new RDN to set
+     * @param deleteOldRdn whether or not to remove the old RDN attr/val
      * @throws Exception if there are any errors propagating the name changes
      */
     @SuppressWarnings("unchecked")
-    public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    public void rename( LdapDN dn, RDN newRdn, boolean deleteOldRdn ) throws Exception
     {
         Long id = getEntryId( dn.getNormName() );
         ServerEntry entry = lookup( id );
@@ -1757,10 +1757,10 @@
         /* 
          * H A N D L E   N E W   R D N
          * ====================================================================
-         * Add the new Rdn attribute to the entry.  If an index exists on the 
-         * new Rdn attribute we add the index for this attribute value pair.
+         * Add the new RDN attribute to the entry.  If an index exists on the 
+         * new RDN attribute we add the index for this attribute value pair.
          * Also we make sure that the presence index shows the existence of the
-         * new Rdn attribute within this entry.
+         * new RDN attribute within this entry.
          */
 
         for ( AVA newAtav : newRdn )
@@ -1787,26 +1787,26 @@
         /*
          * H A N D L E   O L D   R D N
          * ====================================================================
-         * If the old Rdn is to be removed we need to get the attribute and 
-         * value for it.  Keep in mind the old Rdn need not be based on the 
-         * same attr as the new one.  We remove the Rdn value from the entry
-         * and remove the value/id tuple from the index on the old Rdn attr
-         * if any.  We also test if the delete of the old Rdn index tuple 
-         * removed all the attribute values of the old Rdn using a reverse
+         * If the old RDN is to be removed we need to get the attribute and 
+         * value for it.  Keep in mind the old RDN need not be based on the 
+         * same attr as the new one.  We remove the RDN value from the entry
+         * and remove the value/id tuple from the index on the old RDN attr
+         * if any.  We also test if the delete of the old RDN index tuple 
+         * removed all the attribute values of the old RDN using a reverse
          * lookup.  If so that means we blew away the last value of the old 
-         * Rdn attribute.  In this case we need to remove the attrName/id 
+         * RDN attribute.  In this case we need to remove the attrName/id 
          * tuple from the presence index.
          * 
-         * We only remove an ATAV of the old Rdn if it is not included in the
-         * new Rdn.
+         * We only remove an ATAV of the old RDN if it is not included in the
+         * new RDN.
          */
 
         if ( deleteOldRdn )
         {
-            Rdn oldRdn = updn.getRdn();
+            RDN oldRdn = updn.getRdn();
             for ( AVA oldAtav : oldRdn )
             {
-                // check if the new ATAV is part of the old Rdn
+                // check if the new ATAV is part of the old RDN
                 // if that is the case we do not remove the ATAV
                 boolean mustRemove = true;
                 for ( AVA newAtav : newRdn )
@@ -1939,7 +1939,7 @@
 
             /* 
              * Calculate the DN for the child's new name by copying the parents
-             * new name and adding the child's old upRdn to new name as its Rdn
+             * new name and adding the child's old upRdn to new name as its RDN
              */
             LdapDN childUpdn = ( LdapDN ) updn.clone();
             LdapDN oldUpdn = new LdapDN( getEntryUpdn( childId ) );
@@ -1962,7 +1962,7 @@
     }
 
 
-    public void move( LdapDN oldChildDn, LdapDN newParentDn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    public void move( LdapDN oldChildDn, LdapDN newParentDn, RDN newRdn, boolean deleteOldRdn ) throws Exception
     {
         Long childId = getEntryId( oldChildDn.toString() );
         rename( oldChildDn, newRdn, deleteOldRdn );

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Thu Jan 21 00:10:47 2010
@@ -58,10 +58,9 @@
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.loader.ldif.LdifSchemaLoader;
@@ -752,7 +751,7 @@
 
         store.add( entry );
         
-        Rdn rdn = new Rdn("sn=James");
+        RDN rdn = new RDN("sn=James");
         
         store.rename( dn, rdn, true );
     }
@@ -772,7 +771,7 @@
         
         store.add( entry );
         
-        Rdn rdn = new Rdn("sn=Ja\\+es");
+        RDN rdn = new RDN("sn=Ja\\+es");
         
         store.rename( dn, rdn, true );
         
@@ -802,7 +801,7 @@
         LdapDN parentDn = new LdapDN( "ou=Sales,o=Good Times Co." );
         parentDn.normalize( schemaManager.getNormalizerMapping() );
 
-        Rdn rdn = new Rdn("cn=Ryan");
+        RDN rdn = new RDN("cn=Ryan");
 
         store.move( childDn, parentDn, rdn, true );
 

Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java (original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java Thu Jan 21 00:10:47 2010
@@ -75,6 +75,10 @@
         {
             fail();
         }
+        catch ( IOException ioe )
+        {
+            fail();
+        }
         finally
         {
             try

Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java (original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java Thu Jan 21 00:10:47 2010
@@ -42,7 +42,7 @@
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -108,7 +108,7 @@
         Entry entry = session.lookup( new LdapDN( "cn=modifyDnWithString,ou=system" ) );
         assertNotNull( entry );
         
-        Rdn oldRdn = oldDn.getRdn();
+        RDN oldRdn = oldDn.getRdn();
         assertTrue( entry.contains( oldRdn.getUpType(), ( String ) oldRdn.getNormValue() ) );
     }
     
@@ -133,7 +133,7 @@
     {
         ModifyDnRequest modDnReq = new ModifyDnRequest();
         modDnReq.setEntryDn( new LdapDN( dn ) );
-        modDnReq.setNewRdn( new Rdn( "cn=modifyDnWithString" ) );
+        modDnReq.setNewRdn( new RDN( "cn=modifyDnWithString" ) );
         modDnReq.setDeleteOldRdn( true );
 
         final Semaphore lock = new Semaphore(1);

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Thu Jan 21 00:10:47 2010
@@ -54,10 +54,9 @@
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.SystemUtils;
 import org.slf4j.Logger;
@@ -563,7 +562,7 @@
      * 
      * We don't allow filename which length is > 255 chars.
      */
-    private String getFileName( Rdn rdn ) throws NamingException
+    private String getFileName( RDN rdn ) throws NamingException
     {
         // First, get the AT name, or OID
         String normAT = rdn.getAtav().getNormType();
@@ -591,7 +590,7 @@
         StringBuilder sb = new StringBuilder();
         boolean isFirst = true;
         
-        for ( Rdn rdn : dn.getRdns() )
+        for ( RDN rdn : dn.getRdns() )
         {
             // First, get the AT name, or OID
             String normAT = rdn.getAtav().getNormType();

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java Thu Jan 21 00:10:47 2010
@@ -41,7 +41,7 @@
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -243,7 +243,7 @@
     }
 
 
-    public void move( LdapDN oldChildDn, LdapDN newParentDn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    public void move( LdapDN oldChildDn, LdapDN newParentDn, RDN newRdn, boolean deleteOldRdn ) throws Exception
     {
         wrappedStore.move( oldChildDn, newParentDn, newRdn, deleteOldRdn );
     }
@@ -255,7 +255,7 @@
     }
 
 
-    public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    public void rename( LdapDN dn, RDN newRdn, boolean deleteOldRdn ) throws Exception
     {
         wrappedStore.rename( dn, newRdn, deleteOldRdn );
     }

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java Thu Jan 21 00:10:47 2010
@@ -57,9 +57,8 @@
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.loader.ldif.LdifSchemaLoader;
@@ -434,7 +433,7 @@
         LdapDN childDn1 = new LdapDN( "dc=child1,ou=test,ou=system" );
         childDn1.normalize( schemaManager.getNormalizerMapping() );
         
-        Rdn newRdn = new Rdn( SchemaConstants.DC_AT + "=" + "renamedChild1" );
+        RDN newRdn = new RDN( SchemaConstants.DC_AT + "=" + "renamedChild1" );
         RenameOperationContext renameOpCtx = new RenameOperationContext( session, childDn1, newRdn, true );
         partition.rename( renameOpCtx );
         
@@ -460,7 +459,7 @@
         LdapDN childDn1 = new LdapDN( "dc=child1,ou=test,ou=system" );
         childDn1.normalize( schemaManager.getNormalizerMapping() );
         
-        Rdn newRdn = new Rdn( SchemaConstants.DC_AT + "=" + "renamedChild1" );
+        RDN newRdn = new RDN( SchemaConstants.DC_AT + "=" + "renamedChild1" );
         RenameOperationContext renameOpCtx = new RenameOperationContext( session, childDn1, newRdn, false );
         partition.rename( renameOpCtx );
         
@@ -489,7 +488,7 @@
         LdapDN childDn2 = new LdapDN( "dc=child2,ou=test,ou=system" );
         childDn2.normalize( schemaManager.getNormalizerMapping() );
 
-        Rdn newRdn = new Rdn( SchemaConstants.DC_AT + "=" + "movedChild1" );
+        RDN newRdn = new RDN( SchemaConstants.DC_AT + "=" + "movedChild1" );
         MoveAndRenameOperationContext moveAndRenameOpCtx = new MoveAndRenameOperationContext( session, childDn1, childDn2, newRdn, true );
         partition.moveAndRename( moveAndRenameOpCtx );
         
@@ -518,7 +517,7 @@
         LdapDN childDn2 = new LdapDN( "dc=child2,ou=test,ou=system" );
         childDn2.normalize( schemaManager.getNormalizerMapping() );
 
-        Rdn newRdn = new Rdn( SchemaConstants.DC_AT + "=" + "movedChild1" );
+        RDN newRdn = new RDN( SchemaConstants.DC_AT + "=" + "movedChild1" );
         MoveAndRenameOperationContext moveAndRenameOpCtx = new MoveAndRenameOperationContext( session, childDn1, childDn2, newRdn, false );
         partition.moveAndRename( moveAndRenameOpCtx );
         

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=901452&r1=901451&r2=901452&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 Thu Jan 21 00:10:47 2010
@@ -63,7 +63,7 @@
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -360,7 +360,7 @@
 
         modifyDNRequest.setEntry( new LdapDN( dn ) );
         modifyDNRequest.setDeleteOldRDN( entry.isDeleteOldRdn() );
-        modifyDNRequest.setNewRDN( new Rdn( entry.getNewRdn() ) );
+        modifyDNRequest.setNewRDN( new RDN( entry.getNewRdn() ) );
 
         if ( StringTools.isEmpty( entry.getNewSuperior() ) == false )
         {

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java Thu Jan 21 00:10:47 2010
@@ -29,7 +29,7 @@
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
 
@@ -496,24 +496,24 @@
 
     /**
      * Changes the relative distinguished name of an entry specified by a
-     * distinguished name with the optional removal of the old Rdn attribute
+     * distinguished name with the optional removal of the old RDN attribute
      * value from the entry.  Name changes propagate down as dn changes to the
-     * descendants of the entry where the Rdn changed.
+     * descendants of the entry where the RDN changed.
      *
-     * An Rdn change operation does not change parent child relationships.  It
-     * merely propagates a name change at a point in the DIT where the Rdn is
+     * An RDN change operation does not change parent child relationships.  It
+     * merely propagates a name change at a point in the DIT where the RDN is
      * changed. The change propagates down the subtree rooted at the
      * distinguished name specified.
      *
      * @param dn the normalized distinguished name of the entry to alter
-     * @param newRdn the new Rdn to set
-     * @param deleteOldRdn whether or not to remove the old Rdn attr/val
+     * @param newRdn the new RDN to set
+     * @param deleteOldRdn whether or not to remove the old RDN attr/val
      * @throws Exception if there are any errors propagating the name changes
      */
-    void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn ) throws Exception;
+    void rename( LdapDN dn, RDN newRdn, boolean deleteOldRdn ) throws Exception;
 
 
-    void move( LdapDN oldChildDn, LdapDN newParentDn, Rdn newRdn, boolean deleteOldRdn ) throws Exception;
+    void move( LdapDN oldChildDn, LdapDN newParentDn, RDN newRdn, boolean deleteOldRdn ) throws Exception;
 
 
     void move( LdapDN oldChildDn, LdapDN newParentDn ) throws Exception;

Modified: directory/shared/trunk/all/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/all/pom.xml?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/shared/trunk/all/pom.xml (original)
+++ directory/shared/trunk/all/pom.xml Thu Jan 21 00:10:47 2010
@@ -26,78 +26,89 @@
     <artifactId>shared-parent</artifactId>
     <version>0.9.18-SNAPSHOT</version>
   </parent>
+  
   <artifactId>shared-all</artifactId>
   <name>Apache Directory Shared All</name>
   <packaging>jar</packaging>
 
   <dependencies>
-
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-asn1</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-asn1-codec</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-cursor</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-dsml-parser</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-client-api</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-constants</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-converter</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-jndi</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-schema</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-schema-dao</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-schema-loader</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-ldap-schema-manager</artifactId>
       <version>${pom.version}</version>
     </dependency>
-
   </dependencies>
 
   <build>
@@ -118,6 +129,7 @@
           </execution>
         </executions>
       </plugin>
+
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
@@ -134,7 +146,6 @@
           </execution>
         </executions>
       </plugin>
-
     </plugins>
   </build>
 </project>

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java Thu Jan 21 00:10:47 2010
@@ -130,6 +130,7 @@
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.core.filterchain.IoFilter;
 import org.apache.mina.core.future.ConnectFuture;
+import org.apache.mina.core.future.WriteFuture;
 import org.apache.mina.core.service.IoConnector;
 import org.apache.mina.core.service.IoHandlerAdapter;
 import org.apache.mina.core.session.IoEventType;
@@ -551,10 +552,11 @@
      * @return <code>true</code> if the connection is established, false otherwise
      * @throws LdapException if some error has occured
      */
-    private boolean connect() throws LdapException
+    public boolean connect() throws LdapException, IOException
     {
         if ( ( ldapSession != null ) && ldapSession.isConnected() ) 
         {
+            // No need to connect if we already have a connected session
             return true;
         }
 
@@ -587,6 +589,9 @@
                 }
             }
             
+            // Add an executor so that this connection can be used
+            // for handling more than one request (mainly because
+            // we may have to handle some abandon request)
             connector.getFilterChain().addLast( "executor", 
                 new ExecutorFilter( 
                     new UnorderedThreadPoolExecutor( 10 ),
@@ -608,7 +613,15 @@
         if ( !connectionFuture.isConnected() ) 
         {
             // disposing connector if not connected
-            connector.dispose();
+            try
+            {
+                close();
+            }
+            catch ( IOException ioe )
+            {
+                // Nothing to do
+            }
+            
             return false;
         }
         
@@ -667,6 +680,7 @@
         {
             // Release the connector
             connector.dispose();
+            connector = null;
         }
         
         return true;
@@ -883,7 +897,7 @@
      *
      * @return The BindResponse LdapResponse 
      */
-    public BindResponse bind() throws LdapException
+    public BindResponse bind() throws LdapException, IOException
     {
         LOG.debug( "Anonymous Bind request" );
 
@@ -939,7 +953,7 @@
      * @param credentials The password. It can't be null 
      * @return The BindResponse LdapResponse 
      */
-    public BindResponse bind( String name, String credentials ) throws LdapException
+    public BindResponse bind( String name, String credentials ) throws LdapException, IOException
     {
         LOG.debug( "Bind request : {}", name );
 
@@ -955,7 +969,7 @@
      * @param credentials The password. It can't be null 
      * @return The BindResponse LdapResponse 
      */
-    public BindResponse bind( LdapDN name, String credentials ) throws LdapException
+    public BindResponse bind( LdapDN name, String credentials ) throws LdapException, IOException
     {
         LOG.debug( "Bind request : {}", name );
 
@@ -977,7 +991,7 @@
      * @param credentials The password.
      * @return The BindResponse LdapResponse 
      */
-    public BindResponse bind( LdapDN name, byte[] credentials )  throws LdapException
+    public BindResponse bind( LdapDN name, byte[] credentials )  throws LdapException, IOException
     {
         LOG.debug( "Bind request : {}", name );
 
@@ -993,7 +1007,7 @@
      * @param credentials The password.
      * @return The BindResponse LdapResponse 
      */
-    public BindResponse bind( String name, byte[] credentials )  throws LdapException
+    public BindResponse bind( String name, byte[] credentials )  throws LdapException, IOException
     {
         LOG.debug( "Bind request : {}", name );
 
@@ -1027,7 +1041,7 @@
      * parameters 
      * @return A LdapResponse containing the result
      */
-    public BindResponse bind( BindRequest bindRequest ) throws LdapException
+    public BindResponse bind( BindRequest bindRequest ) throws LdapException, IOException
     {
         ResponseFuture responseFuture = bind( bindRequest, null );
         
@@ -1082,7 +1096,7 @@
      * @param listener The listener 
      * @return ResponseFuture A future
      */
-    public ResponseFuture bind( BindRequest bindRequest, BindListener bindListener ) throws LdapException 
+    public ResponseFuture bind( BindRequest bindRequest, BindListener bindListener ) throws LdapException, IOException 
     {
         // First try to connect, if we aren't already connected.
         connect();
@@ -1163,15 +1177,15 @@
         ResponseFuture responseFuture = new ResponseFuture( bindResponseQueue );
         futureMap.put( newId, responseFuture );
 
-        // Send the request to the server
-        ldapSession.write( bindMessage );
-        
         if ( bindListener != null )
         {
             // If this is an asynchronous operation, associate the ID
             // with the operation listener
             listenerMap.put( newId, bindListener );
         }
+
+        // Send the request to the server
+        ldapSession.write( bindMessage );
         
         return responseFuture;
     }
@@ -1423,9 +1437,6 @@
      */
     public void unBind() throws Exception
     {
-        // First try to connect, if we aren't already connected.
-        connect();
-        
         // If the session has not been establish, or is closed, we get out immediately
         checkSession();
         
@@ -1447,10 +1458,12 @@
         LOG.debug( "Sending Unbind request \n{}", unbindMessage );
         
         // Send the request to the server
-        ldapSession.write( unbindMessage );
+        WriteFuture unbindFuture = ldapSession.write( unbindMessage );
+        
+        unbindFuture.awaitUninterruptibly();
         
         //  We now have to close the connection
-        close();
+        //close();
 
         // And get out
         LOG.debug( "Unbind successful" );

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractResponseWithResult.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractResponseWithResult.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractResponseWithResult.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractResponseWithResult.java Thu Jan 21 00:10:47 2010
@@ -33,7 +33,7 @@
     
     /**
      * Creates a new instance of AbstractResponseWithResult.
-     */
+     *
     public AbstractResponseWithResult()
     {
         super();

Added: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/AddFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/AddFuture.java?rev=901452&view=auto
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/AddFuture.java (added)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/AddFuture.java Thu Jan 21 00:10:47 2010
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.client.api.messages.future;
+
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.directory.shared.ldap.client.api.messages.AddResponse;
+
+/**
+ * A Future to manage AddRequests
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class AddFuture extends ResponseFuture<AddResponse>
+{
+    /**
+     * 
+     * Creates a new instance of AddFuture.
+     *
+     * @param addResponseQueue The associated AddResponse queue
+     */
+    public AddFuture( BlockingQueue<AddResponse> addResponseQueue )
+    {
+        super( addResponseQueue );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean cancel( boolean mayInterruptIfRunning )
+    {
+        throw new RuntimeException( "Not Yet Implemented" );
+    }
+
+    
+    /**
+     * Get the AddResponse, blocking until one is received.
+     * 
+     * @return The AddResponse
+     */
+    public AddResponse get() throws InterruptedException, ExecutionException
+    {
+        return responseQueue.poll();
+    }
+
+    
+    /**
+     * Get the AddResponse, blocking until one is received, or until the
+     * given timeout is reached.
+     * 
+     * @param timeout Number of TimeUnit to wait
+     * @param unit The TimeUnit
+     * @return The AddResponse The AddResponse found
+     */
+    public AddResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
+        TimeoutException
+    {
+        return responseQueue.poll( timeout, unit );        
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isCancelled()
+    {
+        throw new RuntimeException( "Not Yet Implemented" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isDone()
+    {
+        throw new RuntimeException( "Not Yet Implemented" );
+    }
+}

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/BindFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/BindFuture.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/BindFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/BindFuture.java Thu Jan 21 00:10:47 2010
@@ -21,7 +21,6 @@
 
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
@@ -33,12 +32,8 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BindFuture implements Future<BindResponse>
+public class BindFuture extends ResponseFuture<BindResponse>
 {
-    /** The queue where BindResponse are stored */
-    private BlockingQueue<BindResponse> bindResponseQueue;
-    
-   
     /**
      * 
      * Creates a new instance of BindFuture.
@@ -47,7 +42,7 @@
      */
     public BindFuture( BlockingQueue<BindResponse> bindResponseQueue )
     {
-        this.bindResponseQueue = bindResponseQueue;
+        super( bindResponseQueue );
     }
     
     
@@ -67,7 +62,7 @@
      */
     public BindResponse get() throws InterruptedException, ExecutionException
     {
-        return bindResponseQueue.poll();
+        return responseQueue.poll();
     }
 
     
@@ -82,7 +77,7 @@
     public BindResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
         TimeoutException
     {
-        return bindResponseQueue.poll( timeout, unit );        
+        return responseQueue.poll( timeout, unit );        
     }
 
     

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/ResponseFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/ResponseFuture.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/ResponseFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/ResponseFuture.java Thu Jan 21 00:10:47 2010
@@ -28,7 +28,6 @@
 import java.util.concurrent.TimeoutException;
 
 import org.apache.directory.shared.ldap.client.api.messages.AbstractResponseWithResult;
-import org.apache.directory.shared.ldap.client.api.messages.Response;
 
 
 /**
@@ -37,17 +36,17 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ResponseFuture implements Future<Response>
+public class ResponseFuture<R> implements Future<R>
 {
     /** the blocking queue holding LDAP responses */
-    private final BlockingQueue<Response> responseQueue;
+    protected BlockingQueue<R> responseQueue;
 
     /** flag to determine if this future is cancelled */
     private boolean cancelled = false;
 
     /** an object to indicate a cancelled/abandoned operation */
-    // 'poision pill shutdown' refer p. 155-156 Java Concurrency in Practice - Brian Goetz
-    private static final Response CANCEL_POISION = new AbstractResponseWithResult(){};
+    // 'poison pill shutdown' refer p. 155-156 Java Concurrency in Practice - Brian Goetz
+    private static AbstractResponseWithResult CANCEL_POISON = new AbstractResponseWithResult(){};
 
 
     /**
@@ -55,7 +54,7 @@
      *
      * @param responseQueue a non-null blocking queue
      */
-    public ResponseFuture( final BlockingQueue responseQueue )
+    public ResponseFuture( BlockingQueue<R> responseQueue )
     {
         if ( responseQueue == null )
         {
@@ -77,7 +76,7 @@
         }
         
         cancelled = true;
-        responseQueue.add( CANCEL_POISION );
+        //responseQueue.add( (Response)CANCEL_POISON );
         
         return cancelled;
     }
@@ -87,11 +86,11 @@
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
-    public Response get() throws InterruptedException, ExecutionException
+    public R get() throws InterruptedException, ExecutionException
     {
-        Response resp = responseQueue.poll();
+        R resp = responseQueue.poll();
         
-        if( resp == CANCEL_POISION )
+        if ( resp == CANCEL_POISON )
         {
             throw new InterruptedException( "cancelled" );
         }
@@ -104,12 +103,12 @@
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
-    public Response get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
+    public R get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
         TimeoutException
     {
-        Response resp = responseQueue.poll( timeout, unit );
+        R resp = (R)responseQueue.poll( timeout, unit );
         
-        if( resp == CANCEL_POISION )
+        if( resp == CANCEL_POISON )
         {
             throw new InterruptedException( "cancelled" );
         }

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java?rev=901452&r1=901451&r2=901452&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java Thu Jan 21 00:10:47 2010
@@ -21,7 +21,6 @@
 
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
@@ -33,12 +32,8 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class SearchFuture implements Future<SearchResponse>
+public class SearchFuture extends ResponseFuture<SearchResponse>
 {
-    /** The queue where SearchResponse are stored */
-    private BlockingQueue<SearchResponse> searchResponseQueue;
-    
-   
     /**
      * 
      * Creates a new instance of SearchFuture.
@@ -47,7 +42,7 @@
      */
     public SearchFuture( BlockingQueue<SearchResponse> searchResponseQueue )
     {
-        this.searchResponseQueue = searchResponseQueue;
+        super( searchResponseQueue );
     }
     
     
@@ -69,7 +64,7 @@
      */
     public SearchResponse get() throws InterruptedException, ExecutionException
     {
-        return searchResponseQueue.poll();
+        return responseQueue.poll();
     }
 
     
@@ -84,7 +79,7 @@
     public SearchResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
         TimeoutException
     {
-        return searchResponseQueue.poll( timeout, unit );        
+        return responseQueue.poll( timeout, unit );        
     }
 
     



Mime
View raw message