Class MultipleResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>
java.lang.Object
org.apache.directory.ldap.client.api.future.MultipleResponseFuture<R>
- Type Parameters:
R- The result type returned by this Future'sgetmethod
- All Implemented Interfaces:
Future<R>, ResponseFuture<R>
- Direct Known Subclasses:
BindFuture, ExtendedFuture, SearchFuture
public abstract class MultipleResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>
extends Object
implements ResponseFuture<R>
A Future implementation used in LdapConnection operations.
- Author:
- Apache Directory Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanflag to determine if this future is cancelledprotected ThrowableIf the request has been cancelled because of an exception it will be stored hereprotected LdapConnectionThe connection used by the requestprotected intThe messageID for this futureprotected BlockingQueue<R> the blocking queue holding LDAP responses -
Constructor Summary
ConstructorsConstructorDescriptionMultipleResponseFuture(LdapConnection connection, int messageId) Creates a new instance of ResponseFuture. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel the Futurebooleancancel(boolean mayInterruptIfRunning) get()getCause()Get the associated causebooleanbooleanisDone()This operation is not supported in this implementation of Future.voidSet the associated Response in this FuturevoidAssociate a cause to the ResponseFuturetoString()
-
Field Details
-
queue
the blocking queue holding LDAP responses -
cancelled
protected boolean cancelledflag to determine if this future is cancelled -
cause
If the request has been cancelled because of an exception it will be stored here -
messageId
protected int messageIdThe messageID for this future -
connection
The connection used by the request
-
-
Constructor Details
-
MultipleResponseFuture
Creates a new instance of ResponseFuture.- Parameters:
connection- The LdapConnection used by the requestmessageId- The associated message ID
-
-
Method Details
-
cancel
-
get
- Specified by:
getin interfaceFuture<R extends org.apache.directory.api.ldap.model.message.Response>- Throws:
InterruptedException- if the operation has been cancelled by client
-
set
Set the associated Response in this Future- Specified by:
setin interfaceResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>- Parameters:
response- The response to add into the Future- Throws:
InterruptedException- if the operation has been cancelled by client
-
get
- Specified by:
getin interfaceFuture<R extends org.apache.directory.api.ldap.model.message.Response>- Throws:
InterruptedException- if the operation has been cancelled by client
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<R extends org.apache.directory.api.ldap.model.message.Response>
-
isDone
-
getCause
Description copied from interface:ResponseFutureGet the associated cause- Specified by:
getCausein interfaceResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>- Returns:
- the cause
-
setCause
Associate a cause to the ResponseFuture- Specified by:
setCausein interfaceResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>- Parameters:
cause- the cause to set
-
cancel
public void cancel()Cancel the Future- Specified by:
cancelin interfaceResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>
-
toString
-