Class RequestHandle
- java.lang.Object
-
- org.forgerock.opendj.ldap.RequestHandle
-
public final class RequestHandle extends Object
Provides the ability to terminate an asynchronous LDAP request.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Completableabandon()Returns aCompletablewhich, once subscribed, will attempt to abandon the operation.Single<Result>cancel()Returns aSingle<Result>which, once subscribed, will attempt to cancel the operation.intgetMessageId()Returns the message ID used to send the request.static RequestHandlenewRequestHandle()Creates a newRequestHandleinstance.
-
-
-
Method Detail
-
newRequestHandle
public static RequestHandle newRequestHandle()
Creates a newRequestHandleinstance.- Returns:
- A new
RequestHandleinstance
-
abandon
public Completable abandon()
Returns aCompletablewhich, once subscribed, will attempt to abandon the operation.Abandon requests do not have a response.
Note: a more convenient approach for abandoning unfinished operations is provided via the
cancel()method.- Returns:
- A
Completablewhich, once subscribed, will attempt to abandon the operation.
-
cancel
public Single<Result> cancel()
Returns aSingle<Result>which, once subscribed, will attempt to cancel the operation.- Returns:
- a
Single<Result>which, once subscribed, will attempt to cancel the operation.
-
getMessageId
public int getMessageId()
Returns the message ID used to send the request.Note that the message ID is only available once the request has been sent which happens once the response
Flowablereturned byLdapClientSocket.send()has been subscribed to. Trying to get the message ID of a request which has not been sent will returns-1.Because a ldap client socket can be virtual (e.g: load balancers), a message ID is not always available. Indeed in some situation a single request handle could actually represent different requests sent to potentially different server. This is refered as a virtual request handle. In this case, the returned message ID will always be
-1.- Returns:
- The message ID used to send the request, or
-1if the request has not been sent or if this request handle is virtual.
-
-