Class UniqueResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>
java.lang.Object
org.apache.directory.ldap.client.api.future.UniqueResponseFuture<R>
- Type Parameters:
R- The result type returned by this Future'sgetmethod
- All Implemented Interfaces:
Future<R>, ResponseFuture<R>
- Direct Known Subclasses:
AddFuture, CompareFuture, DeleteFuture, ModifyDnFuture, ModifyFuture
public abstract class UniqueResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>
extends Object
implements ResponseFuture<R>
A Future implementation used in LdapConnection operations for operations
that only get one single response.
- 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 future -
Constructor Summary
ConstructorsConstructorDescriptionUniqueResponseFuture(LdapConnection connection, int messageId) Creates a new instance of UniqueResponseFuture. -
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
-
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
-
UniqueResponseFuture
Creates a new instance of UniqueResponseFuture.- Parameters:
connection- The LdapConnection used by the requestmessageId- The associated message ID
-
-
Method Details
-
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
-
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
-
cancel
-
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
-