S
- The type of result returned by this promise.public interface LdapPromise<S> extends Promise<S,LdapException>
Modifier and Type | Method and Description |
---|---|
int |
getRequestId()
Returns the request ID of the request if appropriate.
|
<VOUT> LdapPromise<VOUT> |
then(Function<? super S,VOUT,LdapException> onResult)
Submits the provided function for execution once this
Promise has
completed with a result, and returns a new Promise representing
the outcome of the function. |
LdapPromise<S> |
thenAlways(Runnable onResultOrException)
Submits the provided runnable for execution once this
Promise has
completed, and regardless of whether it has a result or an exception. |
<VOUT> LdapPromise<VOUT> |
thenAsync(AsyncFunction<? super S,VOUT,LdapException> onResult)
Submits the provided asynchronous function for execution once this
Promise has completed with a result, and returns a new
Promise representing the outcome of the function. |
LdapPromise<S> |
thenFinally(Runnable onResultOrException)
Submits the provided runnable for execution once this
Promise has
completed, and regardless of whether of its outcome. |
LdapPromise<S> |
thenOnException(ExceptionHandler<? super LdapException> onException)
Registers the provided completion handler for notification if this
Promise cannot be completed due to an exception. |
LdapPromise<S> |
thenOnResult(ResultHandler<? super S> onResult)
Registers the provided completion handler for notification once this
Promise has completed with a result. |
LdapPromise<S> |
thenOnResultOrException(ResultHandler<? super S> onResult,
ExceptionHandler<? super LdapException> onException)
Registers the provided completion handlers for notification once this
Promise has completed (with a result or an exception). |
LdapPromise<S> |
thenOnResultOrException(Runnable onResultOrException)
Submits the provided runnable for execution once this
Promise has
completed, and regardless of whether it has a result or an exception. |
cancel, get, get, getOrThrow, getOrThrow, getOrThrowUninterruptibly, getOrThrowUninterruptibly, isCancelled, isDone, isResult, then, then, thenAsync, thenAsync, thenCatch, thenCatchAsync, thenCatchRuntimeException, thenCatchRuntimeExceptionAsync, thenOnRuntimeException
int getRequestId()
-1
if there is no request ID.LdapPromise<S> thenOnResult(ResultHandler<? super S> onResult)
Promise
Promise
has completed with a result. If this Promise
completes with an exception then the completion handler will not be
notified.
This method can be used for asynchronous completion notification and is
equivalent to Promise.then(Function)
.
thenOnResult
in interface Promise<S,LdapException>
onResult
- The completion handler which will be notified upon successful
completion of this Promise
.Promise
that is guaranted to be completed once the provided
callback has been executed.LdapPromise<S> thenOnException(ExceptionHandler<? super LdapException> onException)
Promise
Promise
cannot be completed due to an exception. If this
Promise
completes with a result then the completion handler
will not be notified.
This method can be used for asynchronous completion notification.
thenOnException
in interface Promise<S,LdapException>
onException
- The completion handler which will be notified upon failure
completion of this Promise
.Promise
that is guaranted to be completed once the provided
callback has been executed.LdapPromise<S> thenOnResultOrException(Runnable onResultOrException)
Promise
Promise
has
completed, and regardless of whether it has a result or an exception.
This method can be used for resource cleanup after a series of
asynchronous tasks have completed. More specifically, this method should
be used in a similar manner to finally
statements in
try...catch
expressions.
This method is equivalent to Promise.thenAlways(Runnable)
.
thenOnResultOrException
in interface Promise<S,LdapException>
onResultOrException
- The runnable which will be notified regardless of the final
outcome of this Promise
.Promise
that is guaranted to be completed once the provided
callback has been executed.<VOUT> LdapPromise<VOUT> then(Function<? super S,VOUT,LdapException> onResult)
Promise
Promise
has
completed with a result, and returns a new Promise
representing
the outcome of the function. If this Promise
does not
complete with a result then the function will not be invoked and the exception
will be forwarded to the returned Promise
.
This method can be used for transforming the result of an asynchronous task.
then
in interface Promise<S,LdapException>
VOUT
- The type of the function's result, or Void
if the
function does not return anything (i.e. it only has
side-effects). Note that the type may be different to the type
of this Promise
.onResult
- The function which will be executed upon successful completion
of this Promise
.Promise
representing the outcome of the
function.LdapPromise<S> thenOnResultOrException(ResultHandler<? super S> onResult, ExceptionHandler<? super LdapException> onException)
Promise
Promise
has completed (with a result or an exception). If this
Promise
completes with a result then onResult
will be
notified with the result, otherwise onException
will be notified
with the exception that occurred.
This method can be used for asynchronous completion notification.
thenOnResultOrException
in interface Promise<S,LdapException>
onResult
- The completion handler which will be notified upon completion
with a result of this Promise
.onException
- The completion handler which will be notified upon failure of
this Promise
.Promise
that is guaranted to be completed once the provided
callback has been executed.LdapPromise<S> thenAlways(Runnable onResultOrException)
Promise
Promise
has
completed, and regardless of whether it has a result or an exception.
This method can be used for resource cleanup after a series of
asynchronous tasks have completed. More specifically, this method should
be used in a similar manner to finally
statements in
try...catch
expressions.
This method is equivalent to Promise.thenOnResultOrException(Runnable)
.
thenAlways
in interface Promise<S,LdapException>
onResultOrException
- The runnable which will be notified regardless of the final
outcome of this Promise
.Promise
that is guaranted to be completed once the provided
callback has been executed.LdapPromise<S> thenFinally(Runnable onResultOrException)
Promise
Promise
has
completed, and regardless of whether of its outcome.
This method can be used for resource cleanup after a series of
asynchronous tasks have completed. More specifically, this method should
be used in a similar manner to finally
statements in
try...catch
expressions.
This method is equivalent to Promise.thenAlways(Runnable)
.
thenFinally
in interface Promise<S,LdapException>
onResultOrException
- The runnable which will be notified regardless of the final
outcome of this Promise
.Promise
that is guaranted to be completed once the provided
callback has been executed.<VOUT> LdapPromise<VOUT> thenAsync(AsyncFunction<? super S,VOUT,LdapException> onResult)
Promise
Promise
has completed with a result, and returns a new
Promise
representing the outcome of the function. If
this Promise
complete with an exception then the function
will not be invoked and the error will be forwarded to the returned
Promise
.
This method may be used for chaining together a series of asynchronous tasks.
thenAsync
in interface Promise<S,LdapException>
VOUT
- The type of the function's result, or Void
if the
function does not return anything (i.e. it only has
side-effects). Note that the type may be different to the type
of this Promise
.onResult
- The asynchronous function which will be executed upon
successful completion of this Promise
.Promise
representing the outcome of the
function.Copyright 2010-2022 ForgeRock AS.