Class SdkConnectionAdapter
- java.lang.Object
-
- org.forgerock.opendj.ldap.AbstractConnection
-
- org.forgerock.opendj.ldap.AbstractAsynchronousConnection
-
- org.opends.server.protocols.http.SdkConnectionAdapter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Connection
public class SdkConnectionAdapter extends AbstractAsynchronousConnection
Adapter class between LDAP SDK'sConnectionand OpenDJ server'sHTTPClientConnection.
-
-
Constructor Summary
Constructors Constructor Description SdkConnectionAdapter(org.opends.server.protocols.http.HTTPClientConnection clientConnection)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.voidaddConnectionEventListener(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.voidclose(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>
LdapPromise<R>extendedRequestAsync(ExtendedRequest<R> request, IntermediateResponseHandler intermediateResponseHandler)Asynchronously performs the provided extended request in the Directory Server.QueueingStrategygetQueueingStrategy()Return the queueing strategy used by this connection.booleanisClosed()Indicates whether this connection has been explicitly closed by callingclose.booleanisValid()Returnstrueif 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.voidremoveConnectionEventListener(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.StringtoString()-
Methods inherited from class org.forgerock.opendj.ldap.AbstractAsynchronousConnection
add, bind, compare, delete, extendedRequest, modify, modifyDN, search
-
Methods inherited from class org.forgerock.opendj.ldap.AbstractConnection
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
-
-
-
-
Method Detail
-
abandonAsync
public LdapPromise<Void> abandonAsync(AbandonRequest request)
Description copied from interface:ConnectionAbandons the unfinished operation identified in the provided abandon request.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.- Parameters:
request- The request identifying the operation to be abandoned.- Returns:
- A promise whose result is Void.
-
addAsync
public LdapPromise<Result> addAsync(AddRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:ConnectionAsynchronously adds an entry to the Directory Server using the provided add request.- Parameters:
request- The add request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
addConnectionEventListener
public void addConnectionEventListener(ConnectionEventListener listener)
Description copied from interface:ConnectionRegisters 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.A listener registered once this connection has already failed and/or been closed is notified of the events it has missed before this method returns.
- Parameters:
listener- The listener which wants to be notified when events occur on this connection.
-
bindAsync
public LdapPromise<BindResult> bindAsync(BindRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:ConnectionAsynchronously authenticates to the Directory Server using the provided bind request.- Parameters:
request- The bind request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
close
public void close(UnbindRequest request, String reason)
Description copied from interface:ConnectionReleases any resources associated with this connection. For physical connections to a Directory Server this will mean that the provided unbind request is sent and the underlying socket is closed.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
closeon a connection that is already closed has no effect.- Parameters:
request- The unbind request to use in the case where a physical connection is closed.reason- A reason describing why the connection was closed.
-
compareAsync
public LdapPromise<CompareResult> compareAsync(CompareRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:ConnectionAsynchronously compares an entry in the Directory Server using the provided compare request.- Parameters:
request- The compare request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
deleteAsync
public LdapPromise<Result> deleteAsync(DeleteRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:ConnectionAsynchronously deletes an entry from the Directory Server using the provided delete request.- Parameters:
request- The delete request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
extendedRequestAsync
public <R extends ExtendedResult> LdapPromise<R> extendedRequestAsync(ExtendedRequest<R> request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:ConnectionAsynchronously performs the provided extended request in the Directory Server.- Type Parameters:
R- The type of result returned by the extended request.- Parameters:
request- The extended request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
getQueueingStrategy
public QueueingStrategy getQueueingStrategy()
Return the queueing strategy used by this connection.- Returns:
- The queueing strategy used by this connection
-
isClosed
public boolean isClosed()
Description copied from interface:ConnectionIndicates whether this connection has been explicitly closed by callingclose. This method will not returntrueif a fatal error has occurred on the connection unlessclosehas been called.- Returns:
trueif this connection has been explicitly closed by callingclose, orfalseotherwise.
-
isValid
public boolean isValid()
Description copied from interface:ConnectionReturnstrueif this connection has not been closed and no fatal errors have been detected. This method is guaranteed to returnfalseonly when it is called after the methodclosehas been called.- Returns:
trueif this connection is valid,falseotherwise.
-
modifyAsync
public LdapPromise<Result> modifyAsync(ModifyRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:ConnectionAsynchronously modifies an entry in the Directory Server using the provided modify request.- Parameters:
request- The modify request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
modifyDNAsync
public LdapPromise<Result> modifyDNAsync(ModifyDNRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:ConnectionAsynchronously renames an entry in the Directory Server using the provided modify DN request.- Parameters:
request- The modify DN request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
removeConnectionEventListener
public void removeConnectionEventListener(ConnectionEventListener listener)
Description copied from interface:ConnectionRemoves 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.- Parameters:
listener- The listener which no longer wants to be notified when events occur on this connection.
-
searchAsync
public LdapPromise<Result> searchAsync(SearchRequest request, IntermediateResponseHandler intermediateResponseHandler, SearchResultHandler entryHandler)
Description copied from interface:ConnectionAsynchronously searches the Directory Server using the provided search request.- Parameters:
request- The search request.intermediateResponseHandler- An intermediate response handler which can be used to process any intermediate responses as they are received, may benull.entryHandler- A search result handler which can be used to asynchronously process the search result entries and references as they are received, may benull.- Returns:
- A promise representing the result of the operation.
-
toString
public String toString()
Description copied from class:AbstractConnectionSub-classes should provide an implementation which returns an appropriate description of the connection which may be used for debugging purposes.
- Specified by:
toStringin classAbstractConnection
-
-