R - The type of the associated Request.S - The type of result returned by this promise.public abstract class ResultLdapPromiseImpl<R extends Request,S extends Result> extends LdapPromiseImpl<S> implements LdapPromise<S>, IntermediateResponseHandler
LdapPromise.Promise,
Promises,
LdapPromise| Modifier and Type | Method and Description |
|---|---|
void |
adaptErrorResult(Result result)
Sets the result associated to this promise as an error result.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
boolean |
checkForTimeout()
Returns
true if this request should be canceled once the timeout
period expires. |
R |
get() |
R |
get(long timeout,
TimeUnit unit) |
R |
getOrThrow() |
R |
getOrThrow(long timeout,
TimeUnit unit) |
R |
getOrThrowUninterruptibly() |
R |
getOrThrowUninterruptibly(long timeout,
TimeUnit unit) |
R |
getRequest()
Returns the attached request.
|
int |
getRequestID()
Returns the request ID of the request if appropriate.
|
long |
getTimestamp()
Returns the creation time of this promise.
|
P |
getWrappedPromise() |
boolean |
handleIntermediateResponse(IntermediateResponse response)
Invoked each time an intermediate response is returned from the Directory
Server.
|
boolean |
isBindOrStartTLS()
Returns
true if this promise represents the result of a bind or
StartTLS request. |
boolean |
isCancelled() |
boolean |
isDone() |
void |
setResultOrError(S result)
Sets the result associated to this promise.
|
<VOUT,EOUT extends Exception> |
then(org.forgerock.util.Function<? super R,VOUT,EOUT> onResult,
org.forgerock.util.Function<? super LdapException,VOUT,EOUT> onException) |
<VOUT> LdapPromise<VOUT> |
then(org.forgerock.util.Function<? super R,VOUT,LdapException> onResult) |
LdapPromise<R> |
thenAlways(Runnable onResultOrException) |
<VOUT,EOUT extends Exception> |
thenAsync(org.forgerock.util.AsyncFunction<? super R,VOUT,EOUT> onResult,
org.forgerock.util.AsyncFunction<? super LdapException,VOUT,EOUT> onException) |
<VOUT> LdapPromise<VOUT> |
thenAsync(org.forgerock.util.AsyncFunction<? super R,VOUT,LdapException> onResult) |
<EOUT extends Exception> |
thenCatch(org.forgerock.util.Function<? super LdapException,R,EOUT> onException) |
<EOUT extends Exception> |
thenCatchAsync(org.forgerock.util.AsyncFunction<? super LdapException,R,EOUT> onException) |
LdapPromise<R> |
thenFinally(Runnable onResultOrException) |
LdapPromise<R> |
thenOnException(org.forgerock.util.promise.ExceptionHandler<? super LdapException> onException) |
LdapPromise<R> |
thenOnResult(org.forgerock.util.promise.ResultHandler<? super R> onResult) |
LdapPromise<R> |
thenOnResultOrException(org.forgerock.util.promise.ResultHandler<? super R> onResult,
org.forgerock.util.promise.ExceptionHandler<? super LdapException> onException) |
LdapPromise<R> |
thenOnResultOrException(Runnable onResultOrException) |
void |
thenOnRuntimeException(org.forgerock.util.promise.RuntimeExceptionHandler onRuntimeException) |
String |
toString()
Returns a string representation of this promise's state.
|
handleException, handleResult, newLdapPromiseImpl, newLdapPromiseImplclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetRequestID, then, thenAlways, thenAsync, thenOnException, thenOnResult, thenOnResultOrException, thenOnResultOrExceptionpublic final boolean handleIntermediateResponse(IntermediateResponse response)
handleIntermediateResponse in interface IntermediateResponseHandlerresponse - The intermediate response.true if this handler should continue to be notified of
any remaining intermediate responses, or false if the
remaining responses should be skipped for some reason (e.g. a
client side size limit has been reached).public boolean isBindOrStartTLS()
true if this promise represents the result of a bind or
StartTLS request. The default implementation is to return false.true if this promise represents the result of a bind or
StartTLS request.public final void adaptErrorResult(Result result)
result - result of an operationpublic final long getTimestamp()
public final void setResultOrError(S result)
result - the result of operationpublic R getRequest()
public boolean checkForTimeout()
true if this request should be canceled once the timeout
period expires. The default implementation is to return true
which will be appropriate for nearly all requests, the one obvious
exception being persistent searches.true if this request should be canceled once the timeout
period expires.public int getRequestID()
LdapPromisegetRequestID in interface LdapPromise<R>-1 if there is no request ID.public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<R>cancel in interface org.forgerock.util.promise.Promise<R,LdapException>public R get() throws ExecutionException, InterruptedException
get in interface Future<R>get in interface org.forgerock.util.promise.Promise<R,LdapException>ExecutionExceptionInterruptedExceptionpublic R get(long timeout, TimeUnit unit) throws ExecutionException, TimeoutException, InterruptedException
get in interface Future<R>get in interface org.forgerock.util.promise.Promise<R,LdapException>ExecutionExceptionTimeoutExceptionInterruptedExceptionpublic R getOrThrow() throws InterruptedException, LdapException
getOrThrow in interface org.forgerock.util.promise.Promise<R,LdapException>InterruptedExceptionLdapExceptionpublic R getOrThrow(long timeout, TimeUnit unit) throws InterruptedException, LdapException, TimeoutException
getOrThrow in interface org.forgerock.util.promise.Promise<R,LdapException>InterruptedExceptionLdapExceptionTimeoutExceptionpublic R getOrThrowUninterruptibly() throws LdapException
getOrThrowUninterruptibly in interface org.forgerock.util.promise.Promise<R,LdapException>LdapExceptionpublic R getOrThrowUninterruptibly(long timeout, TimeUnit unit) throws LdapException, TimeoutException
getOrThrowUninterruptibly in interface org.forgerock.util.promise.Promise<R,LdapException>LdapExceptionTimeoutExceptionpublic boolean isCancelled()
isCancelled in interface Future<R>isCancelled in interface org.forgerock.util.promise.Promise<R,LdapException>public boolean isDone()
isDone in interface Future<R>isDone in interface org.forgerock.util.promise.Promise<R,LdapException>public LdapPromise<R> thenOnException(org.forgerock.util.promise.ExceptionHandler<? super LdapException> onException)
thenOnException in interface LdapPromise<R>thenOnException in interface org.forgerock.util.promise.Promise<R,LdapException>public void thenOnRuntimeException(org.forgerock.util.promise.RuntimeExceptionHandler onRuntimeException)
thenOnRuntimeException in interface org.forgerock.util.promise.Promise<R,LdapException>public LdapPromise<R> thenOnResult(org.forgerock.util.promise.ResultHandler<? super R> onResult)
thenOnResult in interface LdapPromise<R>thenOnResult in interface org.forgerock.util.promise.Promise<R,LdapException>public LdapPromise<R> thenOnResultOrException(Runnable onResultOrException)
thenOnResultOrException in interface LdapPromise<R>thenOnResultOrException in interface org.forgerock.util.promise.Promise<R,LdapException>public <VOUT> LdapPromise<VOUT> then(org.forgerock.util.Function<? super R,VOUT,LdapException> onResult)
then in interface LdapPromise<R>then in interface org.forgerock.util.promise.Promise<R,LdapException>public <VOUT,EOUT extends Exception> org.forgerock.util.promise.Promise<VOUT,EOUT> then(org.forgerock.util.Function<? super R,VOUT,EOUT> onResult, org.forgerock.util.Function<? super LdapException,VOUT,EOUT> onException)
then in interface org.forgerock.util.promise.Promise<R,LdapException>public LdapPromise<R> thenOnResultOrException(org.forgerock.util.promise.ResultHandler<? super R> onResult, org.forgerock.util.promise.ExceptionHandler<? super LdapException> onException)
thenOnResultOrException in interface LdapPromise<R>thenOnResultOrException in interface org.forgerock.util.promise.Promise<R,LdapException>public LdapPromise<R> thenAlways(Runnable onResultOrException)
thenAlways in interface LdapPromise<R>thenAlways in interface org.forgerock.util.promise.Promise<R,LdapException>public <VOUT> LdapPromise<VOUT> thenAsync(org.forgerock.util.AsyncFunction<? super R,VOUT,LdapException> onResult)
thenAsync in interface LdapPromise<R>thenAsync in interface org.forgerock.util.promise.Promise<R,LdapException>public <VOUT,EOUT extends Exception> org.forgerock.util.promise.Promise<VOUT,EOUT> thenAsync(org.forgerock.util.AsyncFunction<? super R,VOUT,EOUT> onResult, org.forgerock.util.AsyncFunction<? super LdapException,VOUT,EOUT> onException)
thenAsync in interface org.forgerock.util.promise.Promise<R,LdapException>public <EOUT extends Exception> org.forgerock.util.promise.Promise<R,EOUT> thenCatch(org.forgerock.util.Function<? super LdapException,R,EOUT> onException)
thenCatch in interface org.forgerock.util.promise.Promise<R,LdapException>public LdapPromise<R> thenFinally(Runnable onResultOrException)
thenFinally in interface org.forgerock.util.promise.Promise<R,LdapException>public <EOUT extends Exception> org.forgerock.util.promise.Promise<R,EOUT> thenCatchAsync(org.forgerock.util.AsyncFunction<? super LdapException,R,EOUT> onException)
thenCatchAsync in interface org.forgerock.util.promise.Promise<R,LdapException>public P getWrappedPromise()
Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.