public final class LdapPromises extends Object
LdapPromise
s.Modifier and Type | Method and Description |
---|---|
static <R> LdapPromise<R> |
asPromise(Promise<R,LdapException> wrappedPromise)
Converts a
Promise to a LdapPromise . |
static BindResultLdapPromiseImpl |
newBindLdapPromise(int requestID,
BindRequest request,
BindClient bindClient,
IntermediateResponseHandler intermediateResponseHandler)
Creates a new bind
BindResultLdapPromiseImpl . |
static ResultLdapPromiseImpl<CompareRequest,CompareResult> |
newCompareLdapPromise(int requestID,
CompareRequest request,
IntermediateResponseHandler intermediateResponseHandler,
Connection connection)
Creates a new compare
ResultLdapPromiseImpl . |
static ResultLdapPromiseImpl<CompareRequest,CompareResult> |
newCompareLdapPromise(int requestID,
CompareRequest request,
IntermediateResponseHandler intermediateResponseHandler,
LDAPConnectionImpl connection)
Creates a new compare
ResultLdapPromiseImpl . |
static <S extends ExtendedResult> |
newExtendedLdapPromise(int requestID,
ExtendedRequest<S> request,
IntermediateResponseHandler intermediateResponseHandler,
Connection connection)
Creates a new extended
ExtendedResultLdapPromiseImpl . |
static <S extends ExtendedResult> |
newExtendedLdapPromise(int requestID,
ExtendedRequest<S> request,
IntermediateResponseHandler intermediateResponseHandler,
LDAPConnectionImpl connection)
Creates a new extended
ExtendedResultLdapPromiseImpl . |
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 extends Request> |
newResultLdapPromise(int requestID,
R request,
IntermediateResponseHandler intermediateResponseHandler,
Connection connection)
Creates a new
ResultLdapPromiseImpl to handle a standard request (add, delete, modify and modidyDN). |
static <R extends Request> |
newResultLdapPromise(int requestID,
R request,
IntermediateResponseHandler intermediateResponseHandler,
LDAPConnectionImpl connection)
Creates a new
ResultLdapPromiseImpl to handle a standard request (add, delete, modify and modidyDN). |
static SearchResultLdapPromiseImpl |
newSearchLdapPromise(int requestID,
SearchRequest request,
SearchResultHandler resultHandler,
IntermediateResponseHandler intermediateResponseHandler,
Connection connection)
Creates a new search
SearchResultLdapPromiseImpl . |
static SearchResultLdapPromiseImpl |
newSearchLdapPromise(int requestID,
SearchRequest request,
SearchResultHandler resultHandler,
IntermediateResponseHandler intermediateResponseHandler,
LDAPConnectionImpl connection)
Creates a new search
SearchResultLdapPromiseImpl . |
static <R> LdapPromise<R> |
newSuccessfulLdapPromise(R result)
Returns a
LdapPromise representing an asynchronous task which has already succeeded with the provided
result. |
static <R> LdapPromise<R> |
newSuccessfulLdapPromise(R result,
int requestID)
Returns a
LdapPromise representing an asynchronous task, identified by the provided requestID, which has
already succeeded with the provided result. |
public static <R> LdapPromise<R> asPromise(Promise<R,LdapException> wrappedPromise)
Promise
to a LdapPromise
.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 BindResultLdapPromiseImpl newBindLdapPromise(int requestID, BindRequest request, BindClient bindClient, IntermediateResponseHandler intermediateResponseHandler)
BindResultLdapPromiseImpl
.requestID
- Identifier of the request.request
- The bind request sent to server.bindClient
- Client that binds to the server.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.BindResultLdapPromiseImpl
.public static ResultLdapPromiseImpl<CompareRequest,CompareResult> newCompareLdapPromise(int requestID, CompareRequest request, IntermediateResponseHandler intermediateResponseHandler, Connection connection)
ResultLdapPromiseImpl
.requestID
- Identifier of the request.request
- The compare request sent to the server.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.ResultLdapPromiseImpl
.public static ResultLdapPromiseImpl<CompareRequest,CompareResult> newCompareLdapPromise(int requestID, CompareRequest request, IntermediateResponseHandler intermediateResponseHandler, LDAPConnectionImpl connection)
ResultLdapPromiseImpl
.requestID
- Identifier of the request.request
- The compare request sent to the server.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.ResultLdapPromiseImpl
.public static <S extends ExtendedResult> ExtendedResultLdapPromiseImpl<S> newExtendedLdapPromise(int requestID, ExtendedRequest<S> request, IntermediateResponseHandler intermediateResponseHandler, Connection connection)
ExtendedResultLdapPromiseImpl
.S
- The type of result returned by this promise.requestID
- Identifier of the request.request
- The extended request sent to the server.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.ExtendedResultLdapPromiseImpl
.public static <S extends ExtendedResult> ExtendedResultLdapPromiseImpl<S> newExtendedLdapPromise(int requestID, ExtendedRequest<S> request, IntermediateResponseHandler intermediateResponseHandler, LDAPConnectionImpl connection)
ExtendedResultLdapPromiseImpl
.S
- The type of result returned by this promise.requestID
- Identifier of the request.request
- The extended request sent to the server.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.ExtendedResultLdapPromiseImpl
.public static <R extends Request> ResultLdapPromiseImpl<R,Result> newResultLdapPromise(int requestID, R request, IntermediateResponseHandler intermediateResponseHandler, Connection connection)
ResultLdapPromiseImpl
to handle a standard request (add, delete, modify and modidyDN).R
- The type of the task's request.requestID
- Identifier of the request.request
- The request sent to the server.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.ResultLdapPromiseImpl
.public static <R extends Request> ResultLdapPromiseImpl<R,Result> newResultLdapPromise(int requestID, R request, IntermediateResponseHandler intermediateResponseHandler, LDAPConnectionImpl connection)
ResultLdapPromiseImpl
to handle a standard request (add, delete, modify and modidyDN).R
- The type of the task's request.requestID
- Identifier of the request.request
- The request sent to the server.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.ResultLdapPromiseImpl
.public static SearchResultLdapPromiseImpl newSearchLdapPromise(int requestID, SearchRequest request, SearchResultHandler resultHandler, IntermediateResponseHandler intermediateResponseHandler, Connection connection)
SearchResultLdapPromiseImpl
.requestID
- Identifier of the request.request
- The search request sent to the server.resultHandler
- Handler that consumes search result.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.SearchResultLdapPromiseImpl
.public static SearchResultLdapPromiseImpl newSearchLdapPromise(int requestID, SearchRequest request, SearchResultHandler resultHandler, IntermediateResponseHandler intermediateResponseHandler, LDAPConnectionImpl connection)
SearchResultLdapPromiseImpl
.requestID
- Identifier of the request.request
- The search request sent to the server.resultHandler
- Handler that consumes search result.intermediateResponseHandler
- Handler that consumes intermediate responses from extended operations.connection
- The connection to directory server.SearchResultLdapPromiseImpl
.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.public static <R> LdapPromise<R> newSuccessfulLdapPromise(R result, int requestID)
LdapPromise
representing an asynchronous task, identified by the provided requestID, 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.requestID
- The request ID of the succeeded task.LdapPromise
representing an asynchronous task which has already succeeded with the provided
result.Copyright 2010-2017 ForgeRock AS.