Package org.forgerock.opendj.ldap
Class AbstractSynchronousConnection
- java.lang.Object
-
- org.forgerock.opendj.ldap.AbstractConnection
-
- org.forgerock.opendj.ldap.AbstractSynchronousConnection
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Connection
public abstract class AbstractSynchronousConnection extends AbstractConnection
An abstract connection whose asynchronous methods are implemented in terms of synchronous methods.NOTE: this implementation does not support intermediate response handlers except for extended operations, because they are not supported by the equivalent synchronous methods.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSynchronousConnection()
Creates a new abstract synchronous connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapPromise<Void>
abandonAsync(AbandonRequest request)
Abandon operations are not supported because operations are performed synchronously and the ID of the request to be abandoned cannot be determined.LdapPromise<Result>
addAsync(AddRequest request, IntermediateResponseHandler intermediateResponseHandler)
Asynchronously adds an entry to the Directory Server using the provided add request.LdapPromise<BindResult>
bindAsync(BindRequest request, IntermediateResponseHandler intermediateResponseHandler)
Asynchronously authenticates to the Directory Server using the provided bind request.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.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.LdapPromise<Result>
searchAsync(SearchRequest request, IntermediateResponseHandler intermediateResponseHandler, SearchResultHandler entryHandler)
Asynchronously searches the Directory Server using the provided search request.-
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, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.forgerock.opendj.ldap.Connection
add, addConnectionEventListener, bind, close, compare, delete, delete, extendedRequest, isClosed, isValid, modify, modifyDn, removeConnectionEventListener, search
-
-
-
-
Method Detail
-
abandonAsync
public LdapPromise<Void> abandonAsync(AbandonRequest request)
Abandon operations are not supported because operations are performed synchronously and the ID of the request to be abandoned cannot be determined. Thread interruption must be used in order to cancel a blocked request.- Parameters:
request
- The request identifying the operation to be abandoned.- Returns:
- A promise whose result is Void.
- Throws:
UnsupportedOperationException
- Always thrown: abandon requests are not supported for synchronous connections.
-
addAsync
public LdapPromise<Result> addAsync(AddRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:Connection
Asynchronously 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.
-
bindAsync
public LdapPromise<BindResult> bindAsync(BindRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:Connection
Asynchronously 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.
-
compareAsync
public LdapPromise<CompareResult> compareAsync(CompareRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:Connection
Asynchronously 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:Connection
Asynchronously 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:Connection
Asynchronously 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.
-
modifyAsync
public LdapPromise<Result> modifyAsync(ModifyRequest request, IntermediateResponseHandler intermediateResponseHandler)
Description copied from interface:Connection
Asynchronously 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:Connection
Asynchronously 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.
-
searchAsync
public LdapPromise<Result> searchAsync(SearchRequest request, IntermediateResponseHandler intermediateResponseHandler, SearchResultHandler entryHandler)
Description copied from interface:Connection
Asynchronously 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.
-
-