directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r910150 [3/11] - in /directory: apacheds/trunk/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/co...
Date Mon, 15 Feb 2010 01:37:47 GMT
Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java (original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java Mon Feb 15 01:37:34 2010
@@ -19,11 +19,11 @@
  */
 package org.apache.directory.ldap.client.api.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.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.message.AddResponse;
 
 /**
@@ -37,32 +37,24 @@
     /**
      * 
      * Creates a new instance of AddFuture.
-     *
-     * @param addResponseQueue The associated AddResponse queue
+     * 
+     * @param connection The LdapConnection
+     * @param messageId The associated messageId
      */
-    public AddFuture( BlockingQueue<AddResponse> addResponseQueue )
+    public AddFuture( LdapConnection connection, int messageId )
     {
-        super( addResponseQueue );
+        super( connection, messageId );
     }
     
     
     /**
-     * {@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();
+        return super.get();
     }
 
     
@@ -77,24 +69,19 @@
     public AddResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
         TimeoutException
     {
-        return responseQueue.poll( timeout, unit );        
+        return super.get( timeout, unit );
     }
-
+    
     
     /**
      * {@inheritDoc}
      */
-    public boolean isCancelled()
-    {
-        throw new RuntimeException( "Not Yet Implemented" );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public boolean isDone()
+    public String toString()
     {
-        throw new RuntimeException( "Not Yet Implemented" );
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "AddFuture" ).append( super.toString() );
+        
+        return sb.toString();
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java (original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java Mon Feb 15 01:37:34 2010
@@ -19,11 +19,11 @@
  */
 package org.apache.directory.ldap.client.api.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.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.message.BindResponse;
 
 /**
@@ -38,31 +38,23 @@
      * 
      * Creates a new instance of BindFuture.
      *
-     * @param bindResponseQueue The associated BindResponse queue
+     * @param connection The LdapConnection
+     * @param messageId The associated messageId
      */
-    public BindFuture( BlockingQueue<BindResponse> bindResponseQueue )
+    public BindFuture( LdapConnection connection, int messageId )
     {
-        super( bindResponseQueue );
+        super( connection, messageId );
     }
     
     
     /**
-     * {@inheritDoc}
-     */
-    public boolean cancel( boolean mayInterruptIfRunning )
-    {
-        throw new RuntimeException( "Not Yet Implemented" );
-    }
-
-    
-    /**
      * Get the BindResponse, blocking until one is received.
      * 
      * @return The BindResponse
      */
     public BindResponse get() throws InterruptedException, ExecutionException
     {
-        return responseQueue.poll();
+        return super.get();
     }
 
     
@@ -77,24 +69,19 @@
     public BindResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
         TimeoutException
     {
-        return responseQueue.poll( timeout, unit );        
+        return super.get( timeout, unit );
     }
-
+    
     
     /**
      * {@inheritDoc}
      */
-    public boolean isCancelled()
-    {
-        throw new RuntimeException( "Not Yet Implemented" );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public boolean isDone()
+    public String toString()
     {
-        throw new RuntimeException( "Not Yet Implemented" );
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "BindFuture" ).append( super.toString() );
+        
+        return sb.toString();
     }
 }

Added: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java?rev=910150&view=auto
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java (added)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java Mon Feb 15 01:37:34 2010
@@ -0,0 +1,87 @@
+/*
+ * 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.ldap.client.api.future;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.message.CompareResponse;
+
+/**
+ * A Future to manage CompareRequest
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class CompareFuture extends ResponseFuture<CompareResponse>
+{
+    /**
+     * 
+     * Creates a new instance of CompareFuture.
+     *
+     * @param connection The LdapConnection
+     * @param messageId The associated messageId
+     */
+    public CompareFuture( LdapConnection connection, int messageId )
+    {
+        super( connection, messageId );
+    }
+    
+    
+    /**
+     * Get the CompareResponse, blocking until one is received.
+     * 
+     * @return The CompareResponse
+     */
+    public CompareResponse get() throws InterruptedException, ExecutionException
+    {
+        return super.get();
+    }
+
+    
+    /**
+     * Get the CompareResponse, 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 CompareResponse The CompareResponse found
+     */
+    public CompareResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
+        TimeoutException
+    {
+        return super.get( timeout, unit );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "CompareFuture" ).append( super.toString() );
+        
+        return sb.toString();
+    }
+}

Added: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java?rev=910150&view=auto
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java (added)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java Mon Feb 15 01:37:34 2010
@@ -0,0 +1,87 @@
+/*
+ * 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.ldap.client.api.future;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.message.DeleteResponse;
+
+/**
+ * A Future to manage DelRequests
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class DeleteFuture extends ResponseFuture<DeleteResponse>
+{
+    /**
+     * 
+     * Creates a new instance of AddFuture.
+     *
+     * @param connection The LdapConnection
+     * @param messageId The associated messageId
+     */
+    public DeleteFuture( LdapConnection connection, int messageId )
+    {
+        super( connection, messageId );
+    }
+    
+    
+    /**
+     * Get the DeleteResponse, blocking until one is received.
+     * 
+     * @return The DeleteResponse
+     */
+    public DeleteResponse get() throws InterruptedException, ExecutionException
+    {
+        return super.get();
+    }
+
+    
+    /**
+     * Get the DeleteResponse, 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 DeleteResponse The DeleteResponse found
+     */
+    public DeleteResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
+        TimeoutException
+    {
+        return super.get( timeout, unit );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "DeleteFuture" ).append( super.toString() );
+        
+        return sb.toString();
+    }
+}

Added: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java?rev=910150&view=auto
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java (added)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java Mon Feb 15 01:37:34 2010
@@ -0,0 +1,86 @@
+/*
+ * 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.ldap.client.api.future;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.message.ExtendedResponse;
+
+/**
+ * A Future to manage ExtendedRequests
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ExtendedFuture extends ResponseFuture<ExtendedResponse>
+{
+   /**
+    *
+    * Creates a new instance of ExtendedFuture.
+    *
+    */
+   public ExtendedFuture( LdapConnection connection, int messageId )
+   {
+       super( connection, messageId );
+   }
+
+
+   /**
+    * Get the ExtendedResponse, blocking until one is received.
+    *
+    * @return The ExtendedResponse
+    */
+   public ExtendedResponse get() throws InterruptedException, ExecutionException
+   {
+       return super.get();
+   }
+
+
+   /**
+    * Get the ExtendedResponse, 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 ExtendedResponse The ExtendedResponse found
+    */
+   public ExtendedResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
+       TimeoutException
+   {
+       return super.get( timeout, unit );
+   }
+
+
+   /**
+    * {@inheritDoc}
+    */
+   public String toString()
+   {
+       StringBuilder sb = new StringBuilder();
+
+       sb.append( "ExtendedFuture" ).append( super.toString() );
+
+       return sb.toString();
+   }
+}
+

Added: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java?rev=910150&view=auto
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java (added)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java Mon Feb 15 01:37:34 2010
@@ -0,0 +1,87 @@
+/*
+ * 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.ldap.client.api.future;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.message.ModifyDnResponse;
+
+/**
+ * A Future to manage ModifyDnRequest
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ModifyDnFuture extends ResponseFuture<ModifyDnResponse>
+{
+    /**
+     * 
+     * Creates a new instance of ModifyDnFuture.
+     *
+     * @param connection The LdapConnection
+     * @param messageId The associated messageId
+     */
+    public ModifyDnFuture( LdapConnection connection, int messageId )
+    {
+        super( connection, messageId );
+    }
+    
+    
+    /**
+     * Get the ModifyDnResponse, blocking until one is received.
+     * 
+     * @return The ModifyDnResponse
+     */
+    public ModifyDnResponse get() throws InterruptedException, ExecutionException
+    {
+        return super.get();
+    }
+
+    
+    /**
+     * Get the ModifyDnResponse, 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 ModifyDnResponse The ModifyDnResponse found
+     */
+    public ModifyDnResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
+        TimeoutException
+    {
+        return super.get( timeout, unit );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "ModifyDnFuture" ).append( super.toString() );
+        
+        return sb.toString();
+    }
+}

Added: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java?rev=910150&view=auto
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java (added)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java Mon Feb 15 01:37:34 2010
@@ -0,0 +1,87 @@
+/*
+ * 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.ldap.client.api.future;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.message.ModifyResponse;
+
+/**
+ * A Future to manage ModifyRequest
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ModifyFuture extends ResponseFuture<ModifyResponse>
+{
+    /**
+     * 
+     * Creates a new instance of ModifyFuture.
+     *
+     * @param connection The LdapConnection
+     * @param messageId The associated messageId
+     */
+    public ModifyFuture( LdapConnection connection, int messageId )
+    {
+        super( connection, messageId );
+    }
+    
+    
+    /**
+     * Get the ModifyResponse, blocking until one is received.
+     * 
+     * @return The ModifyResponse
+     */
+    public ModifyResponse get() throws InterruptedException, ExecutionException
+    {
+        return super.get();
+    }
+
+    
+    /**
+     * Get the ModifyResponse, 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 ModifyResponse The ModifyResponse found
+     */
+    public ModifyResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
+        TimeoutException
+    {
+        return super.get( timeout, unit );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "ModifyFuture" ).append( super.toString() );
+        
+        return sb.toString();
+    }
+}

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java (original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java Mon Feb 15 01:37:34 2010
@@ -24,10 +24,11 @@
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
+import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
-import org.apache.directory.ldap.client.api.message.AbstractResponseWithResult;
+import org.apache.directory.ldap.client.api.LdapConnection;
 
 
 /**
@@ -39,29 +40,28 @@
 public class ResponseFuture<R> implements Future<R>
 {
     /** the blocking queue holding LDAP responses */
-    protected BlockingQueue<R> responseQueue;
-
+    protected BlockingQueue<R> queue;
+    
     /** flag to determine if this future is cancelled */
-    private boolean cancelled = false;
-
-    /** an object to indicate a cancelled/abandoned operation */
-    // 'poison pill shutdown' refer p. 155-156 Java Concurrency in Practice - Brian Goetz
-    private static AbstractResponseWithResult CANCEL_POISON = new AbstractResponseWithResult(){};
-
+    protected boolean cancelled = false;
 
+    /** The messageID for this future */
+    protected int messageId;
+    
+    /** The connection used by the request */
+    protected LdapConnection connection;
+    
     /**
      * Creates a new instance of ResponseFuture.
      *
-     * @param responseQueue a non-null blocking queue
+     * @param connection The LdapConnection used by the request
+     * @param messageId The associated message ID
      */
-    public ResponseFuture( BlockingQueue<R> responseQueue )
+    public ResponseFuture( LdapConnection connection, int messageId )
     {
-        if ( responseQueue == null )
-        {
-            throw new NullPointerException( "response queue cannot be null" );
-        }
-
-        this.responseQueue = responseQueue;
+        queue = new LinkedBlockingQueue<R>();
+        this.messageId = messageId;
+        this.connection = connection;
     }
 
 
@@ -70,13 +70,16 @@
      */
     public boolean cancel( boolean mayInterruptIfRunning )
     {
-        if( cancelled )
+        if ( cancelled )
         {
             return cancelled;
         }
         
+        // Send an abandonRequest
+        connection.abandon( messageId );
+        
+        queue.clear();
         cancelled = true;
-        //responseQueue.add( (Response)CANCEL_POISON );
         
         return cancelled;
     }
@@ -88,14 +91,21 @@
      */
     public R get() throws InterruptedException, ExecutionException
     {
-        R resp = responseQueue.poll();
+        R response = null;
+ 
+        response = queue.take();
         
-        if ( resp == CANCEL_POISON )
-        {
-            throw new InterruptedException( "cancelled" );
-        }
-        
-        return resp;
+        return response;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     * @throws InterruptedException if the operation has been cancelled by client
+     */
+    public synchronized void set( R response ) throws InterruptedException, ExecutionException
+    {
+        queue.add( response );
     }
 
 
@@ -106,14 +116,9 @@
     public R get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
         TimeoutException
     {
-        R resp = (R)responseQueue.poll( timeout, unit );
-        
-        if( resp == CANCEL_POISON )
-        {
-            throw new InterruptedException( "cancelled" );
-        }
-        
-        return resp;
+        R response = queue.poll( timeout, unit );
+    
+        return response;
     }
 
 
@@ -133,5 +138,16 @@
     {
         throw new UnsupportedOperationException( "Operation not supported" );
     }
-
+    
+    
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "[msgId : " ).append( messageId ).append( ", ");
+        sb.append( "size : " ).append( queue.size() ).append( ", " );
+        sb.append( "Canceled :" ).append( cancelled ).append( "]" );
+        
+        return sb.toString();
+    }
 }

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java (original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java Mon Feb 15 01:37:34 2010
@@ -19,11 +19,11 @@
  */
 package org.apache.directory.ldap.client.api.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.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.message.SearchResponse;
 
 /**
@@ -38,24 +38,16 @@
      * 
      * Creates a new instance of SearchFuture.
      *
-     * @param searchResponseQueue The associated SearchResponse queue
+     * @param connection The LdapConnection
+     * @param messageId The associated messageId
      */
-    public SearchFuture( BlockingQueue<SearchResponse> searchResponseQueue )
+    public SearchFuture( LdapConnection connection, int messageId )
     {
-        super( searchResponseQueue );
+        super( connection, messageId );
     }
     
     
     /**
-     * {@inheritDoc}
-     */
-    public boolean cancel( boolean mayInterruptIfRunning )
-    {
-        throw new RuntimeException( "Not Yet Implemented" );
-    }
-
-    
-    /**
      * Get the SearchResponse, blocking until one is received.
      * It can be either a SearchResultEntry, a SearchResultReference
      * or a SearchResultDone, the last of all the SearchResponse.
@@ -64,7 +56,7 @@
      */
     public SearchResponse get() throws InterruptedException, ExecutionException
     {
-        return responseQueue.poll();
+        return super.get();
     }
 
     
@@ -79,24 +71,19 @@
     public SearchResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
         TimeoutException
     {
-        return responseQueue.poll( timeout, unit );        
+        return super.get( timeout, unit );        
     }
-
+    
     
     /**
      * {@inheritDoc}
      */
-    public boolean isCancelled()
-    {
-        throw new RuntimeException( "Not Yet Implemented" );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public boolean isDone()
+    public String toString()
     {
-        throw new RuntimeException( "Not Yet Implemented" );
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "SearchFuture" ).append( super.toString() );
+        
+        return sb.toString();
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java (original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java Mon Feb 15 01:37:34 2010
@@ -48,7 +48,7 @@
         if ( request instanceof LdapMessageCodec )
         {
             LdapMessageCodec ldapRequest = (LdapMessageCodec)request;
-            ByteBuffer bb = ldapRequest.encode( null );
+            ByteBuffer bb = ldapRequest.encode();
             bb.flip();
             
             IoBuffer buffer = IoBuffer.allocate( bb.limit(), false );

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java Mon Feb 15 01:37:34 2010
@@ -25,17 +25,11 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.exception.LdapException;
-import org.apache.directory.ldap.client.api.listener.SearchListener;
+import org.apache.directory.ldap.client.api.future.SearchFuture;
 import org.apache.directory.ldap.client.api.message.SearchRequest;
 import org.apache.directory.ldap.client.api.message.SearchResponse;
 import org.apache.directory.ldap.client.api.message.SearchResultDone;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
-import org.apache.directory.ldap.client.api.message.SearchResultReference;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -50,11 +44,8 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -77,9 +68,6 @@
 
     private CoreSession session;
     
-    private static final Logger LOG = LoggerFactory.getLogger( LdapConnection.class );
-
-
     @Before
     public void setup() throws Exception
     {
@@ -113,7 +101,6 @@
 
 
     @Test
-    @Ignore
     public void testAbandonSearch() throws Exception
     {
         // injecting some values to keep the
@@ -138,53 +125,33 @@
         sr.setScope( SearchScope.ONELEVEL );
         sr.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );
 
-        final AtomicInteger count = new AtomicInteger( 0 );
-        final AtomicBoolean abandonned = new AtomicBoolean( false );
-
-        SearchListener sl = new SearchListener()
-        {
-            public void searchDone( LdapConnection connection, SearchResultDone searchResultDone ) throws LdapException
-            {
-            }
-
-
-            public void referralFound( LdapConnection connection, SearchResultReference searchResultReference )
-                throws LdapException
-            {
-            }
-
-
-            public void entryFound( LdapConnection connection, SearchResultEntry searchResultEntry )
-                throws LdapException
-            {
-                count.incrementAndGet();
-                
-                // Stop the search after a few results, here 13
-                if ( count.get() == 13 )
-                {
-                    int id = searchResultEntry.getMessageId();
-                    assertEquals( numEntries + 2, id );
-                    connection.abandon( id );
-                    abandonned.set( true );
-                }
-            }
-        };
-
         // Launch the search now
-        connection.search( sr, sl );
+        SearchFuture searchFuture = connection.searchAsync( sr );
         
-        while ( !abandonned.get() )
+        SearchResponse searchResponse = null;
+        int count = 0;
+        
+        do
         {
-            Thread.sleep( 100 );
+            searchResponse = searchFuture.get();
+            count++;
+            
+            if ( count > 10 )
+            {
+                searchFuture.cancel( true );
+                break;
+            }
         }
-
-        assertTrue( count.get() < numEntries );
+        while ( !(searchResponse instanceof SearchResultDone ) );
+        
+        assertTrue( numEntries > count );
+        assertTrue( searchFuture.isCancelled() );
 
         // Now do a simple synchronous search
         Cursor<SearchResponse> results = connection.search( sr );
         
         results.beforeFirst();
-        int n = 0;
+        int n = -1;
         
         while ( results.next() )
         {
@@ -192,6 +159,6 @@
             n++;
         }
         
-        assertTrue( n == numEntries + 1 );
+        assertEquals( numEntries, n );
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java Mon Feb 15 01:37:34 2010
@@ -26,11 +26,11 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.exception.LdapException;
-import org.apache.directory.ldap.client.api.listener.AddListener;
+import org.apache.directory.ldap.client.api.future.AddFuture;
 import org.apache.directory.ldap.client.api.message.AddRequest;
 import org.apache.directory.ldap.client.api.message.AddResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -64,7 +64,6 @@
 public class ClientAddRequestTest extends AbstractLdapTestUnit
 {
     private LdapConnection connection;
-    
     private CoreSession session;
     
     @Before
@@ -128,20 +127,20 @@
         
         assertFalse( session.exists( dn ) );
 
-        final Semaphore lock = new Semaphore( 1 );
-        lock.acquire();
-        
-        connection.add( new AddRequest( entry ), new AddListener()
-        {
-            public void entryAdded( LdapConnection connection, AddResponse response ) throws LdapException
-            {
-                assertNotNull( response );
-                assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-                lock.release();
-            }
-        });
+        AddFuture addFuture = connection.addAsync( new AddRequest( entry ));
 
-        lock.acquire();
-        assertTrue( session.exists( dn ) );
+        try
+        {
+            AddResponse addResponse = addFuture.get( 1000, TimeUnit.MILLISECONDS );
+            
+            assertNotNull( addResponse );
+            assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
+            assertTrue( connection.isAuthenticated() );
+            assertTrue( session.exists( dn ) );
+        }
+        catch ( TimeoutException toe )
+        {
+            fail();
+        }
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java Mon Feb 15 01:37:34 2010
@@ -20,15 +20,16 @@
 package org.apache.directory.shared.client.api.operations;
 
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.exception.LdapException;
-import org.apache.directory.ldap.client.api.listener.CompareListener;
+import org.apache.directory.ldap.client.api.future.CompareFuture;
 import org.apache.directory.ldap.client.api.message.CompareRequest;
 import org.apache.directory.ldap.client.api.message.CompareResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -37,6 +38,7 @@
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.junit.After;
 import org.junit.Before;
@@ -113,24 +115,27 @@
     {
         LdapDN dn = new LdapDN( "uid=admin,ou=system" );
 
-        final Semaphore lock = new Semaphore( 1 );
         CompareRequest compareRequest = new CompareRequest();
         compareRequest.setEntryDn( dn );
         compareRequest.setAttrName( SchemaConstants.UID_AT );
         compareRequest.setValue( "admin" );
         
-        connection.compare( compareRequest, new CompareListener()
-        {
-            
-            public void attributeCompared( LdapConnection connection, CompareResponse response ) throws LdapException
-            {
-                assertNotNull( response );
-                assertTrue( response.isTrue() );
-                lock.release();
-            }
-        });
+        connection.compare( compareRequest);
 
-        lock.acquire();
         assertTrue( session.exists( dn ) );
+
+        CompareFuture compareFuture = connection.compareAsync( compareRequest );
+        
+        try
+        {
+            CompareResponse compareResponse = compareFuture.get( 1000, TimeUnit.MILLISECONDS );
+            
+            assertNotNull( compareResponse );
+            assertEquals( ResultCodeEnum.COMPARE_TRUE, compareResponse.getLdapResult().getResultCode() );
+        }
+        catch ( TimeoutException toe )
+        {
+            fail();
+        }
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java Mon Feb 15 01:37:34 2010
@@ -23,17 +23,18 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.lang.reflect.Method;
 import java.util.Map;
-import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.exception.LdapException;
+import org.apache.directory.ldap.client.api.future.DeleteFuture;
 import org.apache.directory.ldap.client.api.listener.DeleteListener;
 import org.apache.directory.ldap.client.api.message.DeleteRequest;
 import org.apache.directory.ldap.client.api.message.DeleteResponse;
@@ -47,6 +48,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -166,6 +168,7 @@
     
 
     @Test
+    @Ignore
     public void testDeleteWithCascadeControl() throws Exception
     {
         LdapDN dn = new LdapDN( "cn=parent,ou=system" );
@@ -195,6 +198,7 @@
      * 
      */
     @Test
+    @Ignore
     public void testDeleteWithoutCascadeControl() throws Exception
     {
         LdapDN dn = new LdapDN( "cn=parent,ou=system" );
@@ -216,6 +220,7 @@
      * @see #testDeleteWithoutCascadeControl()
      */
     @Test
+    @Ignore
     public void testDeleteAsyncWithoutCascadeControl() throws Exception
     {
         LdapDN dn = new LdapDN( "cn=parent,ou=system" );
@@ -255,22 +260,21 @@
         LdapDN dn = new LdapDN( "cn=grand_child12,cn=child1,cn=parent,ou=system" );
         
         assertTrue( session.exists( dn ) );
-
-        final Semaphore delLock = new Semaphore(1);
-        delLock.acquire();
         
-        DeleteResponse response = connection.delete( new DeleteRequest( dn ), new DeleteListener()
-        {
-            public void entryDeleted( LdapConnection connection, DeleteResponse response ) throws LdapException
-            {
-                assertNotNull( response );
-                assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-                delLock.release();
-            }
-        });
+        DeleteFuture deleteFuture = connection.deleteAsync( new DeleteRequest( dn ));
         
-        delLock.acquire();
-        assertNull( response );
-        assertFalse( session.exists( dn ) );
+        try
+        {
+            DeleteResponse deleteResponse = deleteFuture.get( 1000, TimeUnit.MILLISECONDS );
+            
+            assertNotNull( deleteResponse );
+            assertEquals( ResultCodeEnum.SUCCESS, deleteResponse.getLdapResult().getResultCode() );
+            assertTrue( connection.isAuthenticated() );
+            assertFalse( session.exists( dn ) );
+        }
+        catch ( TimeoutException toe )
+        {
+            fail();
+        }
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java Mon Feb 15 01:37:34 2010
@@ -6,36 +6,37 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.client.api.operations;
 
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import javax.naming.ldap.StartTlsRequest;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.exception.LdapException;
-import org.apache.directory.ldap.client.api.listener.ExtendedListener;
+import org.apache.directory.ldap.client.api.future.ExtendedFuture;
 import org.apache.directory.ldap.client.api.message.ExtendedRequest;
 import org.apache.directory.ldap.client.api.message.ExtendedResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
@@ -53,81 +54,79 @@
  * @version $Rev$, $Date$
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" ), 
-        @CreateTransport( protocol = "LDAPS" ) 
-    },
-    extendedOpHandlers = 
-    {
-        StartTlsHandler.class
-    })
+@CreateLdapServer (
+   transports =
+   {
+       @CreateTransport( protocol = "LDAP" ),
+       @CreateTransport( protocol = "LDAPS" )
+   },
+   extendedOpHandlers =
+   {
+       StartTlsHandler.class
+   })
 public class ClientExtendedRequestTest extends AbstractLdapTestUnit
 {
-    private LdapConnection connection;
-    
-    @Before
-    public void setup() throws Exception
-    {
-        connection = new LdapConnection( "localhost", ldapServer.getPort() );
-        LdapDN bindDn = new LdapDN( "uid=admin,ou=system" );
-        connection.bind( bindDn.getName(), "secret" );
-    }
-
-    
-    /**
-     * Close the LdapConnection
-     */
-    @After
-    public void shutdown()
-    {
-        try
-        {
-            if ( connection != null )
-            {
-                connection.close();
-            }
-        }
-        catch( Exception ioe )
-        {
-            fail();
-        }
-    }
-    
-    
-    @Test
-    public void testExtended() throws Exception
-    {
-        ExtendedResponse response = connection.extended( StartTlsRequest.OID );
-        assertNotNull( response );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-    }
-
-    
-    @Test
-    public void testExtendedAsync() throws Exception
-    {
-        ExtendedRequest extendedRequest = new ExtendedRequest( StartTlsRequest.OID );
-        
-        final AtomicBoolean done = new AtomicBoolean( false );
-        
-        ExtendedListener listener = new ExtendedListener()
-        {
-            public void extendedOperationCompleted( LdapConnection connection, ExtendedResponse response ) throws LdapException
-            {
-                assertNotNull( response );
-                assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-                done.set( true );
-            }
-        };
-
-        ExtendedResponse response = connection.extended( extendedRequest, listener );
-        assertNull( response );
-        
-        while( !done.get() )
-        {
-            Thread.sleep( 1000 );
-        }
-    }
-}
+   private LdapConnection connection;
+   private CoreSession session;
+
+   @Before
+   public void setup() throws Exception
+   {
+       connection = new LdapConnection( "localhost", ldapServer.getPort() );
+       LdapDN bindDn = new LdapDN( "uid=admin,ou=system" );
+       connection.bind( bindDn.getName(), "secret" );
+
+       session = ldapServer.getDirectoryService().getSession();
+   }
+
+
+   /**
+    * Close the LdapConnection
+    */
+   @After
+   public void shutdown()
+   {
+       try
+       {
+           if ( connection != null )
+           {
+               connection.close();
+           }
+       }
+       catch( Exception ioe )
+       {
+           fail();
+       }
+   }
+
+
+   @Test
+   public void testExtended() throws Exception
+   {
+       ExtendedResponse response = connection.extended( StartTlsRequest.OID );
+       assertNotNull( response );
+       assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+   }
+
+
+   @Test
+   public void testExtendedAsync() throws Exception
+   {
+       ExtendedRequest extendedRequest = new ExtendedRequest( StartTlsRequest.OID );
+
+       ExtendedFuture extendedFuture = connection.extendedAsync( extendedRequest );
+
+       try
+       {
+           ExtendedResponse extendedResponse = extendedFuture.get( 1000, TimeUnit.MILLISECONDS );
+
+           assertNotNull( extendedResponse );
+           assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
+           assertTrue( connection.isAuthenticated() );
+       }
+       catch ( TimeoutException toe )
+       {
+           fail();
+       }
+   }
+}
\ No newline at end of file

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java Mon Feb 15 01:37:34 2010
@@ -20,18 +20,16 @@
 
 package org.apache.directory.shared.client.api.operations;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.exception.LdapException;
-import org.apache.directory.ldap.client.api.listener.ModifyDnListener;
+import org.apache.directory.ldap.client.api.future.ModifyDnFuture;
 import org.apache.directory.ldap.client.api.message.ModifyDnRequest;
 import org.apache.directory.ldap.client.api.message.ModifyDnResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -41,7 +39,6 @@
 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.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.junit.After;
@@ -151,27 +148,31 @@
     @Test
     public void testModifyDnAsync() throws Exception
     {
+        LdapDN oldDn = new LdapDN( dn );
+        LdapDN newDn = new LdapDN( "cn=modifyDnWithString,ou=system" );
+
         ModifyDnRequest modDnReq = new ModifyDnRequest();
-        modDnReq.setEntryDn( new LdapDN( dn ) );
+        modDnReq.setEntryDn( oldDn );
         modDnReq.setNewRdn( new RDN( "cn=modifyDnWithString" ) );
         modDnReq.setDeleteOldRdn( true );
 
-        final Semaphore lock = new Semaphore(1);
-        lock.acquire();
-
-        ModifyDnResponse resp = connection.modifyDn( modDnReq, new ModifyDnListener()
+        ModifyDnFuture modifyDnFuture = connection.modifyDnAsync( modDnReq );
+        
+        try
         {
-            public void modifyDnCompleted( LdapConnection connection, ModifyDnResponse response ) throws LdapException
-            {
-                assertNotNull( response );
-                assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-                lock.release();
-            }
-        });
+            ModifyDnResponse response = modifyDnFuture.get( 1000, TimeUnit.MILLISECONDS );
+            
+            assertNotNull( response );
+
+            assertTrue( connection.isAuthenticated() );
+            assertFalse( session.exists( oldDn ) );
+            assertTrue( session.exists( newDn ) );
+        }
+        catch ( TimeoutException toe )
+        {
+            fail();
+        }
 
-        lock.acquire();
-        assertNull( resp );
-        assertFalse( session.exists( new LdapDN( dn ) ) );
         assertTrue( session.exists( new LdapDN( "cn=modifyDnWithString,ou=system" ) ) );
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java Mon Feb 15 01:37:34 2010
@@ -22,14 +22,14 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.exception.LdapException;
-import org.apache.directory.ldap.client.api.listener.ModifyListener;
+import org.apache.directory.ldap.client.api.future.ModifyFuture;
 import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.ldap.client.api.message.ModifyResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -42,7 +42,6 @@
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.junit.After;
 import org.junit.Before;
@@ -110,7 +109,7 @@
         ModifyRequest modRequest = new ModifyRequest( dn );
         modRequest.replace( SchemaConstants.SN_AT, expected );
 
-        connection.modify( modRequest, null );
+        connection.modify( modRequest );
 
         ServerEntry entry = session.lookup( dn );
 
@@ -154,27 +153,29 @@
         String expected = String.valueOf( System.currentTimeMillis() );
         ModifyRequest modRequest = new ModifyRequest( dn );
         modRequest.replace( SchemaConstants.SN_AT, expected );
-
-        final Semaphore lock = new Semaphore(1);
-        lock.acquire();
-
-        ModifyResponse response = connection.modify( modRequest, new ModifyListener()
+        
+        assertTrue( session.exists( dn ) );
+        
+        ModifyFuture modifyFuture = connection.modifyAsync( modRequest );
+        
+        try
         {
-            public void modifyCompleted( LdapConnection connection, ModifyResponse response ) throws LdapException
-            {
-                assertNotNull( response );
-                assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-                lock.release();
-            }
-        });
+            ModifyResponse response = modifyFuture.get( 1000, TimeUnit.MILLISECONDS );
+            
+            assertNotNull( response );
 
-        lock.acquire();
-        assertNull( response );
+            ServerEntry entry = session.lookup( dn );
 
-        ServerEntry entry = session.lookup( dn );
+            String actual = entry.get( SchemaConstants.SN_AT ).getString();
 
-        String actual = entry.get( SchemaConstants.SN_AT ).getString();
+            assertEquals( expected, actual );
 
-        assertEquals( expected, actual );
+            assertTrue( connection.isAuthenticated() );
+            assertTrue( session.exists( dn ) );
+        }
+        catch ( TimeoutException toe )
+        {
+            fail();
+        }
     }
 }

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java Mon Feb 15 01:37:34 2010
@@ -25,14 +25,11 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.exception.LdapException;
 import org.apache.directory.ldap.client.api.future.BindFuture;
-import org.apache.directory.ldap.client.api.listener.BindListener;
 import org.apache.directory.ldap.client.api.message.BindRequest;
 import org.apache.directory.ldap.client.api.message.BindResponse;
 import org.apache.directory.ldap.client.api.message.LdapResult;
@@ -100,6 +97,7 @@
     @Test
     public void testSyncBindRequest() throws Exception
     {
+        System.out.println( "testSyncBindRequest" );
         BindResponse bindResponse = connection.bind( "uid=admin,ou=system", "secret" );
         
         assertNotNull( bindResponse );
@@ -116,26 +114,18 @@
     @Test
     public void testAsyncBindRequest() throws Exception
     {
+        System.out.println( "testAsyncBindRequest" );
         int i = 0;
         int nbLoop = 10;
 
-        final Semaphore lock = new Semaphore( 2 );
-        
         for ( ; i < nbLoop; i++)
         {
             BindRequest bindRequest = new BindRequest();
             bindRequest.setName( "uid=admin,ou=system" );
             bindRequest.setCredentials( "secret" );
+            final int messageId = i+1;
             
-            BindFuture bindFuture = connection.bind( bindRequest, new BindListener()
-            {
-                public void bindCompleted( LdapConnection connection, BindResponse bindResponse ) throws LdapException
-                {
-                    assertNotNull( bindResponse );
-                    assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
-                    assertEquals( 1, bindResponse.getMessageId() );
-                }
-            } );
+            BindFuture bindFuture = connection.bindAsync( bindRequest );
             
             try
             {
@@ -159,6 +149,7 @@
     @Test
     public void testSimpleBindAnonymous() throws Exception
     {
+        System.out.println( "testSimpleBindAnonymous" );
         // Try with no parameters
         BindResponse bindResponse = connection.bind();
         
@@ -203,6 +194,7 @@
     @Test
     public void testSimpleBindNoNamePassword() throws Exception
     {
+        System.out.println( "testSimpleBindNoNamePassword" );
         BindResponse response = connection.bind((String)null, "abc" );
         LdapResult ldapResult = response.getLdapResult();
         assertEquals( ResultCodeEnum.INVALID_CREDENTIALS, ldapResult.getResultCode() );
@@ -218,7 +210,8 @@
     @Test
     public void testSimpleBindUnauthenticated() throws Exception
     {
-        BindResponse response = connection.bind( "uid=admin,ou=system" );
+        System.out.println( "testSimpleBindUnauthenticated" );
+        BindResponse response = connection.bind( "uid=admin,ou=system", (String)null );
         LdapResult ldapResult = response.getLdapResult();
         assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, ldapResult.getResultCode() );
         assertEquals( 1, response.getMessageId() );
@@ -233,6 +226,7 @@
     @Test
     public void testSimpleBindValid() throws Exception
     {
+        System.out.println( "testSimpleBindValid" );
         BindResponse response = connection.bind( "uid=admin,ou=system", "secret" );
         LdapResult ldapResult = response.getLdapResult();
         assertEquals( ResultCodeEnum.SUCCESS, ldapResult.getResultCode() );
@@ -247,6 +241,7 @@
     @Test
     public void testSimpleBindValidUserWrongPassword() throws Exception
     {
+        System.out.println( "testSimpleBindValidUserWrongPassword" );
         BindResponse response = connection.bind( "uid=admin,ou=system", "badpassword" );
         LdapResult ldapResult = response.getLdapResult();
         assertEquals( ResultCodeEnum.INVALID_CREDENTIALS, ldapResult.getResultCode() );

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/resources/log4j.properties?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/resources/log4j.properties (original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/resources/log4j.properties Mon Feb 15 01:37:34 2010
@@ -21,4 +21,7 @@
 log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
 
 #log4j.logger.org.apache.directory.shared.client.api=DEBUG
-log4j.logger.org.apache.directory.shared.asn1.ber=ERROR
\ No newline at end of file
+log4j.logger.org.apache.directory.shared.asn1.ber=OFF
+log4j.logger.org.apache.directory.ldap.client.api=OFF
+log4j.logger.org.apache.directory.ldap.client.api.protocol.LdapProtocolDecoder=OFF
+log4j.logger.org.apache.directory.ldap.client.api.LdapConnection=OFF
\ No newline at end of file

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/LdapMessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/LdapMessageDecorator.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/LdapMessageDecorator.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/LdapMessageDecorator.java Mon Feb 15 01:37:34 2010
@@ -25,11 +25,11 @@
 import java.util.List;
 
 import org.apache.directory.shared.asn1.AbstractAsn1Object;
-import org.apache.directory.shared.asn1.Asn1Object;
 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.LdapResponseCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
 import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.codec.add.AddResponseCodec;
@@ -94,7 +94,13 @@
     @Override
     public int computeLength()
     {
-        return instance.computeLength();
+        return 0;
+    }
+
+    @Override
+    public int computeLengthProtocolOp()
+    {
+        return 0;
     }
 
 
@@ -104,77 +110,76 @@
     @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
-        return instance.encode( buffer );
+        return null;
+    }
+
+
+    @Override
+    public void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
+    {
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getAbandonRequest()
      */
-    @Override
     public AbandonRequestCodec getAbandonRequest()
     {
-        return instance.getAbandonRequest();
+        return (AbandonRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getAddRequest()
      */
-    @Override
     public AddRequestCodec getAddRequest()
     {
-        return instance.getAddRequest();
+        return (AddRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getAddResponse()
      */
-    @Override
     public AddResponseCodec getAddResponse()
     {
-        return instance.getAddResponse();
+        return (AddResponseCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getBindRequest()
      */
-    @Override
     public BindRequestCodec getBindRequest()
     {
-        return instance.getBindRequest();
+        return (BindRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getBindResponse()
      */
-    @Override
     public BindResponseCodec getBindResponse()
     {
-        return instance.getBindResponse();
+        return (BindResponseCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getCompareRequest()
      */
-    @Override
     public CompareRequestCodec getCompareRequest()
     {
-        return instance.getCompareRequest();
+        return (CompareRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getCompareResponse()
      */
-    @Override
     public CompareResponseCodec getCompareResponse()
     {
-        return instance.getCompareResponse();
+        return (CompareResponseCodec)instance;
     }
 
 
@@ -211,50 +216,45 @@
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getDelRequest()
      */
-    @Override
     public DelRequestCodec getDelRequest()
     {
-        return instance.getDelRequest();
+        return (DelRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getDelResponse()
      */
-    @Override
     public DelResponseCodec getDelResponse()
     {
-        return instance.getDelResponse();
+        return (DelResponseCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getExtendedRequest()
      */
-    @Override
     public ExtendedRequestCodec getExtendedRequest()
     {
-        return instance.getExtendedRequest();
+        return (ExtendedRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getExtendedResponse()
      */
-    @Override
     public ExtendedResponseCodec getExtendedResponse()
     {
-        return instance.getExtendedResponse();
+        return (ExtendedResponseCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getLdapResponse()
      */
-    @Override
     public LdapResponseCodec getLdapResponse()
     {
-        return instance.getLdapResponse();
+        return (LdapResponseCodec)instance;
     }
 
 
@@ -272,7 +272,7 @@
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getMessageType()
      */
     @Override
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
         return instance.getMessageType();
     }
@@ -291,90 +291,81 @@
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getModifyDNRequest()
      */
-    @Override
     public ModifyDNRequestCodec getModifyDNRequest()
     {
-        return instance.getModifyDNRequest();
+        return (ModifyDNRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getModifyDNResponse()
      */
-    @Override
     public ModifyDNResponseCodec getModifyDNResponse()
     {
-        return instance.getModifyDNResponse();
+        return (ModifyDNResponseCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getModifyRequest()
      */
-    @Override
     public ModifyRequestCodec getModifyRequest()
     {
-        return instance.getModifyRequest();
+        return (ModifyRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getModifyResponse()
      */
-    @Override
     public ModifyResponseCodec getModifyResponse()
     {
-        return instance.getModifyResponse();
+        return (ModifyResponseCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getSearchRequest()
      */
-    @Override
     public SearchRequestCodec getSearchRequest()
     {
-        return instance.getSearchRequest();
+        return (SearchRequestCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getSearchResultDone()
      */
-    @Override
     public SearchResultDoneCodec getSearchResultDone()
     {
-        return instance.getSearchResultDone();
+        return (SearchResultDoneCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getSearchResultEntry()
      */
-    @Override
     public SearchResultEntryCodec getSearchResultEntry()
     {
-        return instance.getSearchResultEntry();
+        return (SearchResultEntryCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getSearchResultReference()
      */
-    @Override
     public SearchResultReferenceCodec getSearchResultReference()
     {
-        return instance.getSearchResultReference();
+        return (SearchResultReferenceCodec)instance;
     }
 
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#getUnBindRequest()
      */
-    @Override
     public UnBindRequestCodec getUnBindRequest()
     {
-        return instance.getUnBindRequest();
+        return (UnBindRequestCodec)instance;
     }
 
 
@@ -389,16 +380,6 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#setProtocolOP(org.apache.directory.shared.asn1.Asn1Object)
-     */
-    @Override
-    public void setProtocolOP( Asn1Object protocolOp )
-    {
-        instance.setProtocolOP( protocolOp );
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapMessageCodec#toString()
      */
     @Override



Mime
View raw message