public final class LdapPromises extends Object
LdapPromise
s.Modifier and Type | Method and Description |
---|---|
static <R> LdapPromise<R> |
asLdapPromise(Promise<R,LdapException> wrappedPromise)
Converts a
Promise to a LdapPromise with a request ID of -1. |
static <R> LdapPromise<R> |
asLdapPromise(Promise<R,LdapException> wrappedPromise,
int requestId)
Converts a
Promise to a LdapPromise with the provided request ID. |
static <R,E extends LdapException> |
newFailedLdapPromise(E error)
Returns a
LdapPromise representing an asynchronous task which has already failed with the provided
error. |
static <R,E extends LdapException> |
newFailedLdapPromise(E error,
int requestId)
Returns a
LdapPromise representing an asynchronous task, identified by the provided requestId, which has
already failed with the provided error. |
static <R> LdapPromise<R> |
newSuccessfulLdapPromise(R result)
Returns a
LdapPromise representing an asynchronous task which has already succeeded with the provided
result. |
public static <R> LdapPromise<R> asLdapPromise(Promise<R,LdapException> wrappedPromise)
Promise
to a LdapPromise
with a request ID of -1.R
- The type of the task's result, or Void
if the task does not return anything (i.e. it only has
side-effects).wrappedPromise
- The Promise
to wrap.LdapPromise
representing the same asynchronous task as the Promise
provided.public static <R> LdapPromise<R> asLdapPromise(Promise<R,LdapException> wrappedPromise, int requestId)
Promise
to a LdapPromise
with the provided request ID.R
- The type of the task's result, or Void
if the task does not return anything (i.e. it only has
side-effects).wrappedPromise
- The Promise
to wrap.requestId
- The request ID.LdapPromise
representing the same asynchronous task as the Promise
provided.public static <R,E extends LdapException> LdapPromise<R> newFailedLdapPromise(E error)
LdapPromise
representing an asynchronous task which has already failed with the provided
error.R
- The type of the task's result, or Void
if the task does not return anything (i.e. it only has
side-effects).E
- The type of the exception thrown by the task if it fails.error
- The exception indicating why the asynchronous task has failed.LdapPromise
representing an asynchronous task which has already failed with the provided error.public static <R,E extends LdapException> LdapPromise<R> newFailedLdapPromise(E error, int requestId)
LdapPromise
representing an asynchronous task, identified by the provided requestId, which has
already failed with the provided error.R
- The type of the task's result, or Void
if the task does not return anything (i.e. it only has
side-effects).E
- The type of the exception thrown by the task if it fails.error
- The exception indicating why the asynchronous task has failed.requestId
- The request ID of the failed task.LdapPromise
representing an asynchronous task which has already failed with the provided error.public static <R> LdapPromise<R> newSuccessfulLdapPromise(R result)
LdapPromise
representing an asynchronous task which has already succeeded with the provided
result. Attempts to get the result will immediately return the result.R
- The type of the task's result, or Void
if the task does not return anything (i.e. it only has
side-effects).result
- The result of the asynchronous task.LdapPromise
representing an asynchronous task which has already succeeded with the provided
result.Copyright © 2010-2018, ForgeRock All Rights Reserved.