S - The type of result returned by this promise.public class LdapPromiseImpl<S> extends Object implements LdapPromise<S>, LdapResultHandler<S>
LdapPromise.Promise,
Promises,
LdapPromise| Modifier | Constructor and Description |
|---|---|
protected |
LdapPromiseImpl(org.forgerock.util.promise.PromiseImpl<S,LdapException> wrappedPromise,
int requestID)
Creates a new
LdapPromiseImpl from a wrapped existing PromiseImpl. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
R |
get() |
R |
get(long timeout,
TimeUnit unit) |
R |
getOrThrow() |
R |
getOrThrow(long timeout,
TimeUnit unit) |
R |
getOrThrowUninterruptibly() |
R |
getOrThrowUninterruptibly(long timeout,
TimeUnit unit) |
int |
getRequestID()
Returns the request ID of the request if appropriate.
|
P |
getWrappedPromise() |
void |
handleException(LdapException exception)
Invoked when the asynchronous operation has failed.
|
void |
handleResult(S result)
Invoked when the asynchronous operation has completed successfully.
|
boolean |
isCancelled() |
boolean |
isDone() |
static <S> LdapPromiseImpl<S> |
newLdapPromiseImpl()
Creates a new
LdapPromiseImpl. |
static <S> LdapPromiseImpl<S> |
newLdapPromiseImpl(int requestID)
Creates a new
LdapPromiseImpl with a requestID. |
<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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRequestID, then, thenAlways, thenAsync, thenOnException, thenOnResult, thenOnResultOrException, thenOnResultOrExceptionprotected LdapPromiseImpl(org.forgerock.util.promise.PromiseImpl<S,LdapException> wrappedPromise, int requestID)
LdapPromiseImpl from a wrapped existing PromiseImpl.wrappedPromise - The Promise to wrap.requestID - Identifier of the request.public static <S> LdapPromiseImpl<S> newLdapPromiseImpl()
LdapPromiseImpl.S - The type of result of the promise.LdapPromiseImplpublic static <S> LdapPromiseImpl<S> newLdapPromiseImpl(int requestID)
LdapPromiseImpl with a requestID.S - The type of result of the promise.requestID - Identifier of the request.LdapPromiseImplpublic void handleException(LdapException exception)
LdapResultHandlerhandleException in interface LdapResultHandler<S>handleException in interface org.forgerock.util.promise.ExceptionHandler<LdapException>exception - The error result exception indicating why the asynchronous
operation has failed.public void handleResult(S result)
LdapResultHandlerhandleResult in interface LdapResultHandler<S>handleResult in interface org.forgerock.util.promise.ResultHandler<S>result - The result of the asynchronous operation.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.