public class SdkConnectionAdapter extends AbstractAsynchronousConnection
Connection
and OpenDJ server's
HTTPClientConnection
.Constructor and Description |
---|
SdkConnectionAdapter(org.opends.server.protocols.http.HTTPClientConnection clientConnection)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
LdapPromise<Void> |
abandonAsync(AbandonRequest request)
Abandons the unfinished operation identified in the provided abandon
request.
|
LdapPromise<Result> |
addAsync(AddRequest request,
IntermediateResponseHandler intermediateResponseHandler)
Asynchronously adds an entry to the Directory Server using the provided
add request.
|
void |
addConnectionEventListener(ConnectionEventListener listener)
Registers the provided connection event listener so that it will be
notified when this connection is closed by the application, receives an
unsolicited notification, or experiences a fatal error.
|
LdapPromise<BindResult> |
bindAsync(BindRequest request,
IntermediateResponseHandler intermediateResponseHandler)
Asynchronously authenticates to the Directory Server using the provided
bind request.
|
void |
close(UnbindRequest request,
String reason)
Releases any resources associated with this connection.
|
LdapPromise<CompareResult> |
compareAsync(CompareRequest request,
IntermediateResponseHandler intermediateResponseHandler)
Asynchronously compares an entry in the Directory Server using the
provided compare request.
|
LdapPromise<Result> |
deleteAsync(DeleteRequest request,
IntermediateResponseHandler intermediateResponseHandler)
Asynchronously deletes an entry from the Directory Server using the
provided delete request.
|
<R extends ExtendedResult> |
extendedRequestAsync(ExtendedRequest<R> request,
IntermediateResponseHandler intermediateResponseHandler)
Asynchronously performs the provided extended request in the Directory
Server.
|
QueueingStrategy |
getQueueingStrategy()
Return the queueing strategy used by this connection.
|
boolean |
isClosed()
Indicates whether this connection has been explicitly closed by
calling
close . |
boolean |
isValid()
Returns
true if this connection has not been closed and no fatal
errors have been detected. |
LdapPromise<Result> |
modifyAsync(ModifyRequest request,
IntermediateResponseHandler intermediateResponseHandler)
Asynchronously modifies an entry in the Directory Server using the
provided modify request.
|
LdapPromise<Result> |
modifyDNAsync(ModifyDNRequest request,
IntermediateResponseHandler intermediateResponseHandler)
Asynchronously renames an entry in the Directory Server using the
provided modify DN request.
|
void |
removeConnectionEventListener(ConnectionEventListener listener)
Removes the provided connection event listener from this connection so
that it will no longer be notified when this connection is closed by the
application, receives an unsolicited notification, or experiences a fatal
error.
|
LdapPromise<Result> |
searchAsync(SearchRequest request,
IntermediateResponseHandler intermediateResponseHandler,
SearchResultHandler entryHandler)
Asynchronously searches the Directory Server using the provided search
request.
|
String |
toString() |
add, bind, compare, delete, extendedRequest, modify, modifyDN, search
add, add, addAsync, applyChange, applyChangeAsync, applyChangeAsync, bind, bindAsync, close, compare, compareAsync, delete, deleteAsync, deleteSubtree, extendedRequest, extendedRequest, extendedRequestAsync, modify, modifyAsync, modifyDN, modifyDNAsync, readEntry, readEntry, readEntryAsync, search, search, search, search, searchAsync, searchSingleEntry, searchSingleEntry, searchSingleEntryAsync
public SdkConnectionAdapter(org.opends.server.protocols.http.HTTPClientConnection clientConnection)
clientConnection
- the HTTP client connection being "adapted"public LdapPromise<Void> abandonAsync(AbandonRequest request)
Connection
Abandon requests do not have a response, so invoking the method get() on the returned promise will not block, nor return anything (it is Void), but may throw an exception if a problem occurred while sending the abandon request. In addition the returned promise may be used in order to determine the message ID of the abandon request.
Note: a more convenient approach to abandoning unfinished
asynchronous operations is provided via the
Promise.cancel(boolean)
method.
request
- The request identifying the operation to be abandoned.public LdapPromise<Result> addAsync(AddRequest request, IntermediateResponseHandler intermediateResponseHandler)
Connection
request
- The add request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.public void addConnectionEventListener(ConnectionEventListener listener)
Connection
listener
- The listener which wants to be notified when events occur on
this connection.public LdapPromise<BindResult> bindAsync(BindRequest request, IntermediateResponseHandler intermediateResponseHandler)
Connection
request
- The bind request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.public void close(UnbindRequest request, String reason)
Connection
Other connection implementations may behave differently, and may choose to ignore the provided unbind request if its use is inappropriate (for example a pooled connection will be released and returned to its connection pool without ever issuing an unbind request).
Calling close
on a connection that is already closed has no
effect.
request
- The unbind request to use in the case where a physical
connection is closed.reason
- A reason describing why the connection was closed.public LdapPromise<CompareResult> compareAsync(CompareRequest request, IntermediateResponseHandler intermediateResponseHandler)
Connection
request
- The compare request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.public LdapPromise<Result> deleteAsync(DeleteRequest request, IntermediateResponseHandler intermediateResponseHandler)
Connection
request
- The delete request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.public <R extends ExtendedResult> LdapPromise<R> extendedRequestAsync(ExtendedRequest<R> request, IntermediateResponseHandler intermediateResponseHandler)
Connection
R
- The type of result returned by the extended request.request
- The extended request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.public QueueingStrategy getQueueingStrategy()
public boolean isClosed()
Connection
close
. This method will not return true
if a
fatal error has occurred on the connection unless close
has been
called.true
if this connection has been explicitly closed by
calling close
, or false
otherwise.public boolean isValid()
Connection
true
if this connection has not been closed and no fatal
errors have been detected. This method is guaranteed to return
false
only when it is called after the method close
has
been called.true
if this connection is valid, false
otherwise.public LdapPromise<Result> modifyAsync(ModifyRequest request, IntermediateResponseHandler intermediateResponseHandler)
Connection
request
- The modify request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.public LdapPromise<Result> modifyDNAsync(ModifyDNRequest request, IntermediateResponseHandler intermediateResponseHandler)
Connection
request
- The modify DN request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.public void removeConnectionEventListener(ConnectionEventListener listener)
Connection
listener
- The listener which no longer wants to be notified when events
occur on this connection.public LdapPromise<Result> searchAsync(SearchRequest request, IntermediateResponseHandler intermediateResponseHandler, SearchResultHandler entryHandler)
Connection
request
- The search request.intermediateResponseHandler
- An intermediate response handler which can be used to process
any intermediate responses as they are received, may be
null
.entryHandler
- A search result handler which can be used to asynchronously
process the search result entries and references as they are
received, may be null
.public String toString()
AbstractConnection
Sub-classes should provide an implementation which returns an appropriate description of the connection which may be used for debugging purposes.
toString
in class AbstractConnection
Copyright 2010-2017 ForgeRock AS.