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 io.reactivex.rxjava3.core.Completable
abandon()
Returns aCompletable
which, once subscribed, will attempt to abandon the operation.io.reactivex.rxjava3.core.Single<Result>
cancel()
Returns aSingle<Result>
which, once subscribed, will attempt to cancel the operation.int
getMessageId()
Returns the message ID used to send the request.static RequestHandle
newRequestHandle()
Creates a newRequestHandle
instance.
-
-
-
Method Detail
-
newRequestHandle
public static RequestHandle newRequestHandle()
Creates a newRequestHandle
instance.- Returns:
- A new
RequestHandle
instance
-
abandon
public io.reactivex.rxjava3.core.Completable abandon()
Returns aCompletable
which, 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
Completable
which, once subscribed, will attempt to abandon the operation.
-
cancel
public io.reactivex.rxjava3.core.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
Flowable
returned 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
-1
if the request has not been sent or if this request handle is virtual.
-
-