public class ApacheLdapConnection extends Object implements ProviderConnection
| Modifier and Type | Class and Description |
|---|---|
protected class |
ApacheLdapConnection.AbstractApacheLdapSearch
Common search functionality for apache ldap iterators and listeners.
|
protected class |
ApacheLdapConnection.ApacheLdapSearchIterator
Search iterator for apache ldap search results.
|
protected class |
ApacheLdapConnection.ApacheLdapSearchListener
Search listener for apache ldap search results.
|
| Modifier and Type | Field and Description |
|---|---|
private ApacheLdapProviderConfig |
config
Provider configuration.
|
private org.apache.directory.ldap.client.api.LdapNetworkConnection |
connection
Ldap connection.
|
protected Logger |
logger
Logger for this class.
|
| Constructor and Description |
|---|
ApacheLdapConnection(org.apache.directory.ldap.client.api.LdapNetworkConnection lc,
ApacheLdapProviderConfig pc)
Creates a new apache ldap connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abandon(int messageId,
RequestControl[] controls) |
Response<Void> |
add(AddRequest request) |
void |
addUnsolicitedNotificationListener(UnsolicitedNotificationListener listener) |
protected Response<Void> |
anonymousBind(BindRequest request)
Performs an anonymous bind.
|
Response<Void> |
bind(BindRequest request) |
void |
close(RequestControl[] controls) |
Response<Boolean> |
compare(CompareRequest request) |
protected <T> Response<T> |
createResponse(Request request,
T result,
org.apache.directory.api.ldap.model.message.ResultResponse resultResponse)
Creates an operation response with the supplied response data.
|
Response<Void> |
delete(DeleteRequest request) |
Response<?> |
extendedOperation(ExtendedRequest request) |
org.apache.directory.ldap.client.api.LdapNetworkConnection |
getLdapConnection()
Returns the underlying ldap connection.
|
org.apache.directory.api.ldap.model.message.Control[] |
getResponseControls(org.apache.directory.api.ldap.model.message.Message response)
Retrieves the response controls from the supplied response.
|
Response<Void> |
modify(ModifyRequest request) |
Response<Void> |
modifyDn(ModifyDnRequest request) |
protected void |
processLdapException(org.apache.directory.api.ldap.model.exception.LdapException e)
Determines if the supplied ldap exception should result in an operation exception.
|
protected void |
processLdapOperationException(org.apache.directory.api.ldap.model.exception.LdapOperationException e)
Determines if the supplied ldap exception should result in an operation exception.
|
ResponseControl[] |
processResponseControls(ControlProcessor<org.apache.directory.api.ldap.model.message.Control> processor,
RequestControl[] requestControls,
org.apache.directory.api.ldap.model.message.Message response)
Retrieves the response controls from the supplied response and processes them with the supplied control processor.
|
void |
removeUnsolicitedNotificationListener(UnsolicitedNotificationListener listener) |
protected Response<Void> |
saslBind(BindRequest request)
Performs a sasl bind.
|
SearchIterator |
search(SearchRequest request) |
void |
searchAsync(SearchRequest request,
SearchListener listener) |
protected Response<Void> |
simpleBind(BindRequest request)
Performs a simple bind.
|
protected void |
throwOperationException(Request request,
org.apache.directory.api.ldap.model.message.ResultResponse resultResponse)
Determines if the supplied response should result in an operation retry.
|
protected final Logger logger
private org.apache.directory.ldap.client.api.LdapNetworkConnection connection
private final ApacheLdapProviderConfig config
public ApacheLdapConnection(org.apache.directory.ldap.client.api.LdapNetworkConnection lc,
ApacheLdapProviderConfig pc)
lc - ldap connectionpc - provider configurationpublic org.apache.directory.ldap.client.api.LdapNetworkConnection getLdapConnection()
public void close(RequestControl[] controls) throws LdapException
close in interface ProviderConnectionLdapExceptionpublic Response<Void> bind(BindRequest request) throws LdapException
bind in interface ProviderConnectionLdapExceptionprotected Response<Void> anonymousBind(BindRequest request) throws LdapException
request - to bind withLdapException - if an error occursprotected Response<Void> simpleBind(BindRequest request) throws LdapException
request - to bind withLdapException - if an error occursprotected Response<Void> saslBind(BindRequest request) throws LdapException
request - to bind withLdapException - if an error occurspublic Response<Void> add(AddRequest request) throws LdapException
add in interface ProviderConnectionLdapExceptionpublic Response<Boolean> compare(CompareRequest request) throws LdapException
compare in interface ProviderConnectionLdapExceptionpublic Response<Void> delete(DeleteRequest request) throws LdapException
delete in interface ProviderConnectionLdapExceptionpublic Response<Void> modify(ModifyRequest request) throws LdapException
modify in interface ProviderConnectionLdapExceptionpublic Response<Void> modifyDn(ModifyDnRequest request) throws LdapException
modifyDn in interface ProviderConnectionLdapExceptionpublic SearchIterator search(SearchRequest request) throws LdapException
search in interface ProviderConnectionLdapExceptionpublic void searchAsync(SearchRequest request, SearchListener listener) throws LdapException
searchAsync in interface ProviderConnectionLdapExceptionpublic void abandon(int messageId,
RequestControl[] controls)
throws LdapException
abandon in interface ProviderConnectionLdapExceptionpublic Response<?> extendedOperation(ExtendedRequest request) throws LdapException
extendedOperation in interface ProviderConnectionLdapExceptionpublic void addUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
addUnsolicitedNotificationListener in interface ProviderConnectionpublic void removeUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
removeUnsolicitedNotificationListener in interface ProviderConnectionprotected void throwOperationException(Request request, org.apache.directory.api.ldap.model.message.ResultResponse resultResponse) throws LdapException
request - that produced the exceptionresultResponse - provider responseLdapException - wrapping the ldap exceptionprotected <T> Response<T> createResponse(Request request, T result, org.apache.directory.api.ldap.model.message.ResultResponse resultResponse)
T - type of responserequest - containing controlsresult - of the operationresultResponse - provider responseprotected void processLdapOperationException(org.apache.directory.api.ldap.model.exception.LdapOperationException e)
throws LdapException
e - that was producedLdapException - wrapping the ldap exceptionprotected void processLdapException(org.apache.directory.api.ldap.model.exception.LdapException e)
throws LdapException
e - that was producedLdapException - wrapping the ldap exceptionpublic ResponseControl[] processResponseControls(ControlProcessor<org.apache.directory.api.ldap.model.message.Control> processor, RequestControl[] requestControls, org.apache.directory.api.ldap.model.message.Message response)
processor - control processorrequestControls - that produced this responseresponse - to get controls frompublic org.apache.directory.api.ldap.model.message.Control[] getResponseControls(org.apache.directory.api.ldap.model.message.Message response)
response - to get controls fromCopyright © 2003-2016 Virginia Tech. All Rights Reserved.