org.apache.directory.ldap.client.api.future
Class SearchFuture

java.lang.Object
  extended by org.apache.directory.ldap.client.api.future.ResponseFuture<org.apache.directory.api.ldap.model.message.Response>
      extended by org.apache.directory.ldap.client.api.future.SearchFuture
All Implemented Interfaces:
Future<org.apache.directory.api.ldap.model.message.Response>

public class SearchFuture
extends ResponseFuture<org.apache.directory.api.ldap.model.message.Response>

A Future to manage SerachRequest.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.ldap.client.api.future.ResponseFuture
cancelled, cause, connection, messageId, queue
 
Constructor Summary
SearchFuture(LdapConnection connection, int messageId)
          Creates a new instance of SearchFuture.
 
Method Summary
 org.apache.directory.api.ldap.model.message.Response get()
          Get the SearchResponse, blocking until one is received.
 org.apache.directory.api.ldap.model.message.Response get(long timeout, TimeUnit unit)
          Get the SearchResponse, blocking until one is received, or until the given timeout is reached.
 String toString()
          
 
Methods inherited from class org.apache.directory.ldap.client.api.future.ResponseFuture
cancel, cancel, getCause, isCancelled, isDone, set, setCause
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchFuture

public SearchFuture(LdapConnection connection,
                    int messageId)
Creates a new instance of SearchFuture.

Parameters:
connection - the LDAP connection
messageId - The associated messageId
Method Detail

get

public org.apache.directory.api.ldap.model.message.Response get()
                                                         throws InterruptedException,
                                                                ExecutionException
Get the SearchResponse, blocking until one is received. It can be either a SearchResultEntry, a SearchResultReference or a SearchResultDone, the last of all the search responses.

Specified by:
get in interface Future<org.apache.directory.api.ldap.model.message.Response>
Overrides:
get in class ResponseFuture<org.apache.directory.api.ldap.model.message.Response>
Returns:
the response, either a SearchResultEntry, a SearchResultReference, or a SearchResultDone
Throws:
InterruptedException - if the operation has been cancelled by client
ExecutionException

get

public org.apache.directory.api.ldap.model.message.Response get(long timeout,
                                                                TimeUnit unit)
                                                         throws InterruptedException,
                                                                ExecutionException,
                                                                TimeoutException
Get the SearchResponse, blocking until one is received, or until the given timeout is reached. It can be either a SearchResultEntry, a SearchResultReference or a SearchResultDone, the last of all the search responses. Get the ModifyResponse, blocking until one is received, or until the given timeout is reached.

Specified by:
get in interface Future<org.apache.directory.api.ldap.model.message.Response>
Overrides:
get in class ResponseFuture<org.apache.directory.api.ldap.model.message.Response>
Parameters:
timeout -
unit -
Returns:
the response, either a SearchResultEntry, a SearchResultReference, or a SearchResultDone
Throws:
InterruptedException - if the operation has been cancelled by client
ExecutionException
TimeoutException

toString

public String toString()

Overrides:
toString in class ResponseFuture<org.apache.directory.api.ldap.model.message.Response>


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.