Package org.ldaptive.provider.opendj
Class OpenDJConnection
- java.lang.Object
-
- org.ldaptive.provider.opendj.OpenDJConnection
-
- All Implemented Interfaces:
ProviderConnection
public class OpenDJConnection extends Object implements ProviderConnection
OpenDJ provider implementation of ldap operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classOpenDJConnection.AbstractOpenDJSearchCommon search functionality for opendj iterators and listeners.protected classOpenDJConnection.AggregateUnsolicitedNotificationListenerAllows the use of multiple unsolicited notification listeners per connection.protected classOpenDJConnection.OpenDJAsyncRequestAsync request to invoke abandons.protected classOpenDJConnection.OpenDJAsyncSearchListenerSearch listener for opendj id async search results.protected classOpenDJConnection.OpenDJSearchIteratorSearch iterator for opendj search results.
-
Field Summary
Fields Modifier and Type Field Description private OpenDJProviderConfigconfigProvider configuration.private org.forgerock.opendj.ldap.ConnectionconnectionLdap connection.protected LoggerloggerLogger for this class.private OpenDJConnection.AggregateUnsolicitedNotificationListenernotificationListenerConnection event listener for unsolicited notifications.
-
Constructor Summary
Constructors Constructor Description OpenDJConnection(org.forgerock.opendj.ldap.Connection c, OpenDJProviderConfig pc)Creates a new opendj ldap connection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabandon(int messageId, RequestControl[] controls)Response<Void>add(AddRequest request)voidaddUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)protected Response<Void>anonymousBind(BindRequest request)Performs an anonymous bind.Response<Void>bind(BindRequest request)voidclose(RequestControl[] controls)Response<Boolean>compare(CompareRequest request)protected <T> Response<T>createResponse(Request request, T result, org.forgerock.opendj.ldap.responses.Result ldapResult)Creates an operation response with the supplied response data.Response<Void>delete(DeleteRequest request)Response<?>extendedOperation(ExtendedRequest request)org.forgerock.opendj.ldap.ConnectiongetLdapConnection()Returns the underlying ldap connection.protected static StringgetQualityOfProtection(QualityOfProtection qop)Returns the SASL quality of protection string for the supplied enum.Response<Void>modify(ModifyRequest request)Response<Void>modifyDn(ModifyDnRequest request)protected voidprocessErrorResultException(Request request, org.forgerock.opendj.ldap.ErrorResultException e)Determines if the supplied error result exception should result in an operation retry.voidremoveUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)protected Response<Void>saslBind(BindRequest request)Performs a sasl bind.SearchIteratorsearch(SearchRequest request)voidsearchAsync(SearchRequest request, SearchListener listener)protected Response<Void>simpleBind(BindRequest request)Performs a simple bind.
-
-
-
Field Detail
-
logger
protected final Logger logger
Logger for this class.
-
connection
private org.forgerock.opendj.ldap.Connection connection
Ldap connection.
-
config
private final OpenDJProviderConfig config
Provider configuration.
-
notificationListener
private final OpenDJConnection.AggregateUnsolicitedNotificationListener notificationListener
Connection event listener for unsolicited notifications.
-
-
Constructor Detail
-
OpenDJConnection
public OpenDJConnection(org.forgerock.opendj.ldap.Connection c, OpenDJProviderConfig pc)Creates a new opendj ldap connection.- Parameters:
c- ldap connectionpc- provider configuration
-
-
Method Detail
-
getLdapConnection
public org.forgerock.opendj.ldap.Connection getLdapConnection()
Returns the underlying ldap connection.- Returns:
- ldap connection
-
close
public void close(RequestControl[] controls) throws LdapException
- Specified by:
closein interfaceProviderConnection- Throws:
LdapException
-
bind
public Response<Void> bind(BindRequest request) throws LdapException
- Specified by:
bindin interfaceProviderConnection- Throws:
LdapException
-
anonymousBind
protected Response<Void> anonymousBind(BindRequest request) throws LdapException
Performs an anonymous bind.- Parameters:
request- to bind with- Returns:
- bind response
- Throws:
LdapException- if an error occurs
-
simpleBind
protected Response<Void> simpleBind(BindRequest request) throws LdapException
Performs a simple bind.- Parameters:
request- to bind with- Returns:
- bind response
- Throws:
LdapException- if an error occurs
-
saslBind
protected Response<Void> saslBind(BindRequest request) throws LdapException
Performs a sasl bind.- Parameters:
request- to bind with- Returns:
- bind response
- Throws:
LdapException- if an error occurs
-
getQualityOfProtection
protected static String getQualityOfProtection(QualityOfProtection qop)
Returns the SASL quality of protection string for the supplied enum.- Parameters:
qop- quality of protection enum- Returns:
- SASL quality of protection string
-
add
public Response<Void> add(AddRequest request) throws LdapException
- Specified by:
addin interfaceProviderConnection- Throws:
LdapException
-
compare
public Response<Boolean> compare(CompareRequest request) throws LdapException
- Specified by:
comparein interfaceProviderConnection- Throws:
LdapException
-
delete
public Response<Void> delete(DeleteRequest request) throws LdapException
- Specified by:
deletein interfaceProviderConnection- Throws:
LdapException
-
modify
public Response<Void> modify(ModifyRequest request) throws LdapException
- Specified by:
modifyin interfaceProviderConnection- Throws:
LdapException
-
modifyDn
public Response<Void> modifyDn(ModifyDnRequest request) throws LdapException
- Specified by:
modifyDnin interfaceProviderConnection- Throws:
LdapException
-
search
public SearchIterator search(SearchRequest request) throws LdapException
- Specified by:
searchin interfaceProviderConnection- Throws:
LdapException
-
searchAsync
public void searchAsync(SearchRequest request, SearchListener listener) throws LdapException
- Specified by:
searchAsyncin interfaceProviderConnection- Throws:
LdapException
-
abandon
public void abandon(int messageId, RequestControl[] controls) throws LdapException- Specified by:
abandonin interfaceProviderConnection- Throws:
LdapException
-
extendedOperation
public Response<?> extendedOperation(ExtendedRequest request) throws LdapException
- Specified by:
extendedOperationin interfaceProviderConnection- Throws:
LdapException
-
addUnsolicitedNotificationListener
public void addUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
- Specified by:
addUnsolicitedNotificationListenerin interfaceProviderConnection
-
removeUnsolicitedNotificationListener
public void removeUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
- Specified by:
removeUnsolicitedNotificationListenerin interfaceProviderConnection
-
createResponse
protected <T> Response<T> createResponse(Request request, T result, org.forgerock.opendj.ldap.responses.Result ldapResult)
Creates an operation response with the supplied response data.- Type Parameters:
T- type of response- Parameters:
request- containing controlsresult- of the operationldapResult- provider result- Returns:
- operation response
-
processErrorResultException
protected void processErrorResultException(Request request, org.forgerock.opendj.ldap.ErrorResultException e) throws LdapException
Determines if the supplied error result exception should result in an operation retry.- Parameters:
request- that produced the exceptione- that was produced- Throws:
LdapException- wrapping the error result exception
-
-