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)
Abandon an operation.
|
Response<Void> |
add(AddRequest request)
Add an entry to an ldap.
|
void |
addUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
Adds a listener to receive unsolicited notifications.
|
protected Response<Void> |
anonymousBind(BindRequest request)
Performs an anonymous bind.
|
Response<Void> |
bind(BindRequest request)
Bind to the ldap.
|
void |
close(RequestControl[] controls)
Tear down this connection to an LDAP.
|
Response<Boolean> |
compare(CompareRequest request)
Compare an entry in the ldap.
|
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)
Delete an entry in the ldap.
|
Response<?> |
extendedOperation(ExtendedRequest request)
Perform an extended operation in the ldap.
|
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)
Modify an entry in the ldap.
|
Response<Void> |
modifyDn(ModifyDnRequest request)
Modify the DN of an entry in the ldap.
|
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)
Removes a listener from receiving unsolicited notifications.
|
protected Response<Void> |
saslBind(BindRequest request)
Performs a sasl bind.
|
SearchIterator |
search(SearchRequest request)
Search the ldap.
|
void |
searchAsync(SearchRequest request,
SearchListener listener)
Search the ldap asynchronously.
|
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
ProviderConnection
close
in interface ProviderConnection
controls
- request controlsLdapException
- if an LDAP error occurspublic Response<Void> bind(BindRequest request) throws LdapException
ProviderConnection
bind
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occursprotected 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
ProviderConnection
add
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occurspublic Response<Boolean> compare(CompareRequest request) throws LdapException
ProviderConnection
compare
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occurspublic Response<Void> delete(DeleteRequest request) throws LdapException
ProviderConnection
delete
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occurspublic Response<Void> modify(ModifyRequest request) throws LdapException
ProviderConnection
modify
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occurspublic Response<Void> modifyDn(ModifyDnRequest request) throws LdapException
ProviderConnection
modifyDn
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occurspublic SearchIterator search(SearchRequest request) throws LdapException
ProviderConnection
search
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occurspublic void searchAsync(SearchRequest request, SearchListener listener) throws LdapException
ProviderConnection
searchAsync
in interface ProviderConnection
request
- containing the data necessary to perform the operationlistener
- to be notified as results arriveLdapException
- if an error occurspublic void abandon(int messageId, RequestControl[] controls) throws LdapException
ProviderConnection
abandon
in interface ProviderConnection
messageId
- of the operation to abandoncontrols
- request controlsLdapException
- if an error occurspublic Response<?> extendedOperation(ExtendedRequest request) throws LdapException
ProviderConnection
extendedOperation
in interface ProviderConnection
request
- containing the data necessary to perform the operationLdapException
- if an error occurspublic void addUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
ProviderConnection
addUnsolicitedNotificationListener
in interface ProviderConnection
listener
- to receive unsolicited notificationspublic void removeUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
ProviderConnection
removeUnsolicitedNotificationListener
in interface ProviderConnection
listener
- that was registered to receive unsolicited notificationsprotected 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-2019 Virginia Tech. All Rights Reserved.