Author: elecharny Date: Mon May 4 21:00:39 2009 New Revision: 771439 URL: http://svn.apache.org/viewvc?rev=771439&view=rev Log: The SearchFuture now manage a Response instead of a SearchResponse, as we have to provide the SearchResultDone instance back to the client Modified: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java Modified: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java?rev=771439&r1=771438&r2=771439&view=diff ============================================================================== --- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java (original) +++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/future/SearchFuture.java Mon May 4 21:00:39 2009 @@ -25,18 +25,20 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.apache.directory.shared.ldap.client.api.messages.SearchResponse; +import org.apache.directory.shared.ldap.client.api.messages.Response; /** - * A Future to manage SerachRequest + * A Future to manage SearchRequest. The searchResponseQueue contains + * all the entries or referral, with a last element being a searchResultDone + * response. * * @author Apache Directory Project * @version $Rev$, $Date$ */ -public class SearchFuture implements Future +public class SearchFuture implements Future { /** The queue where SearchResponse are stored */ - private BlockingQueue searchResponseQueue; + private BlockingQueue searchResponseQueue; /** @@ -45,7 +47,7 @@ * * @param searchResponseQueue The associated SearchResponse queue */ - public SearchFuture( BlockingQueue searchResponseQueue ) + public SearchFuture( BlockingQueue searchResponseQueue ) { this.searchResponseQueue = searchResponseQueue; } @@ -65,9 +67,10 @@ * It can be either a SearchResultEntry, a SearchResultReference * or a SearchResultDone, the last of all the SearchResponse. * - * @return The SearchResponse + * @return The Response (either a SearchResponse instance - ie entry + * or referral) or a SearchResultDone */ - public SearchResponse get() throws InterruptedException, ExecutionException + public Response get() throws InterruptedException, ExecutionException { return searchResponseQueue.poll(); } @@ -79,9 +82,10 @@ * * @param timeout Number of TimeUnit to wait * @param unit The TimeUnit - * @return The SearchResponse The SearchResponse found + * @return The SearchResponse The SearchResponse found (either a + * SearchResponse instance - ie entry or referral) or a SearchResultDone */ - public SearchResponse get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException, + public Response get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException, TimeoutException { return searchResponseQueue.poll( timeout, unit );