org.ldaptive.provider.opendj
Class OpenDJConnection

java.lang.Object
  extended by org.ldaptive.provider.opendj.OpenDJConnection
All Implemented Interfaces:
org.ldaptive.provider.ProviderConnection

public class OpenDJConnection
extends Object
implements org.ldaptive.provider.ProviderConnection

OpenDJ provider implementation of ldap operations.

Version:
$Revision: 2943 $ $Date: 2014-03-31 11:49:06 -0400 (Mon, 31 Mar 2014) $
Author:
Middleware Services

Nested Class Summary
protected  class OpenDJConnection.AbstractOpenDJSearch
          Common search functionality for opendj iterators and listeners.
protected  class OpenDJConnection.AggregateUnsolicitedNotificationListener
          Allows the use of multiple unsolicited notification listeners per connection.
protected  class OpenDJConnection.OpenDJAsyncRequest
          Async request to invoke abandons.
protected  class OpenDJConnection.OpenDJAsyncSearchListener
          Search listener for opendj id async search results.
protected  class OpenDJConnection.OpenDJSearchIterator
          Search iterator for opendj search results.
 
Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
OpenDJConnection(org.forgerock.opendj.ldap.Connection c, OpenDJProviderConfig pc)
          Creates a new opendj ldap connection.
 
Method Summary
 void abandon(int messageId, org.ldaptive.control.RequestControl[] controls)
          
 org.ldaptive.Response<Void> add(org.ldaptive.AddRequest request)
          
 void addUnsolicitedNotificationListener(org.ldaptive.extended.UnsolicitedNotificationListener listener)
          
protected  org.ldaptive.Response<Void> anonymousBind(org.ldaptive.BindRequest request)
          Performs an anonymous bind.
 org.ldaptive.Response<Void> bind(org.ldaptive.BindRequest request)
          
 void close(org.ldaptive.control.RequestControl[] controls)
          
 org.ldaptive.Response<Boolean> compare(org.ldaptive.CompareRequest request)
          
protected
<T> org.ldaptive.Response<T>
createResponse(org.ldaptive.Request request, T result, org.forgerock.opendj.ldap.responses.Result ldapResult)
          Creates an operation response with the supplied response data.
 org.ldaptive.Response<Void> delete(org.ldaptive.DeleteRequest request)
          
 org.ldaptive.Response<?> extendedOperation(org.ldaptive.extended.ExtendedRequest request)
          
 org.forgerock.opendj.ldap.Connection getLdapConnection()
          Returns the underlying ldap connection.
protected static String getQualityOfProtection(org.ldaptive.sasl.QualityOfProtection qop)
          Returns the SASL quality of protection string for the supplied enum.
 org.ldaptive.Response<Void> modify(org.ldaptive.ModifyRequest request)
          
 org.ldaptive.Response<Void> modifyDn(org.ldaptive.ModifyDnRequest request)
          
protected  void processErrorResultException(org.ldaptive.Request request, org.forgerock.opendj.ldap.ErrorResultException e)
          Determines if the supplied error result exception should result in an operation retry.
 void removeUnsolicitedNotificationListener(org.ldaptive.extended.UnsolicitedNotificationListener listener)
          
protected  org.ldaptive.Response<Void> saslBind(org.ldaptive.BindRequest request)
          Performs a sasl bind.
 org.ldaptive.provider.SearchIterator search(org.ldaptive.SearchRequest request)
          
 void searchAsync(org.ldaptive.SearchRequest request, org.ldaptive.provider.SearchListener listener)
          
protected  org.ldaptive.Response<Void> simpleBind(org.ldaptive.BindRequest request)
          Performs a simple bind.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

OpenDJConnection

public OpenDJConnection(org.forgerock.opendj.ldap.Connection c,
                        OpenDJProviderConfig pc)
Creates a new opendj ldap connection.

Parameters:
c - ldap connection
pc - provider configuration
Method Detail

getLdapConnection

public org.forgerock.opendj.ldap.Connection getLdapConnection()
Returns the underlying ldap connection.

Returns:
ldap connection

close

public void close(org.ldaptive.control.RequestControl[] controls)
           throws org.ldaptive.LdapException

Specified by:
close in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

bind

public org.ldaptive.Response<Void> bind(org.ldaptive.BindRequest request)
                                 throws org.ldaptive.LdapException

Specified by:
bind in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

anonymousBind

protected org.ldaptive.Response<Void> anonymousBind(org.ldaptive.BindRequest request)
                                             throws org.ldaptive.LdapException
Performs an anonymous bind.

Parameters:
request - to bind with
Returns:
bind response
Throws:
org.ldaptive.LdapException - if an error occurs

simpleBind

protected org.ldaptive.Response<Void> simpleBind(org.ldaptive.BindRequest request)
                                          throws org.ldaptive.LdapException
Performs a simple bind.

Parameters:
request - to bind with
Returns:
bind response
Throws:
org.ldaptive.LdapException - if an error occurs

saslBind

protected org.ldaptive.Response<Void> saslBind(org.ldaptive.BindRequest request)
                                        throws org.ldaptive.LdapException
Performs a sasl bind.

Parameters:
request - to bind with
Returns:
bind response
Throws:
org.ldaptive.LdapException - if an error occurs

getQualityOfProtection

protected static String getQualityOfProtection(org.ldaptive.sasl.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 org.ldaptive.Response<Void> add(org.ldaptive.AddRequest request)
                                throws org.ldaptive.LdapException

Specified by:
add in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

compare

public org.ldaptive.Response<Boolean> compare(org.ldaptive.CompareRequest request)
                                       throws org.ldaptive.LdapException

Specified by:
compare in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

delete

public org.ldaptive.Response<Void> delete(org.ldaptive.DeleteRequest request)
                                   throws org.ldaptive.LdapException

Specified by:
delete in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

modify

public org.ldaptive.Response<Void> modify(org.ldaptive.ModifyRequest request)
                                   throws org.ldaptive.LdapException

Specified by:
modify in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

modifyDn

public org.ldaptive.Response<Void> modifyDn(org.ldaptive.ModifyDnRequest request)
                                     throws org.ldaptive.LdapException

Specified by:
modifyDn in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

search

public org.ldaptive.provider.SearchIterator search(org.ldaptive.SearchRequest request)
                                            throws org.ldaptive.LdapException

Specified by:
search in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

searchAsync

public void searchAsync(org.ldaptive.SearchRequest request,
                        org.ldaptive.provider.SearchListener listener)
                 throws org.ldaptive.LdapException

Specified by:
searchAsync in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

abandon

public void abandon(int messageId,
                    org.ldaptive.control.RequestControl[] controls)
             throws org.ldaptive.LdapException

Specified by:
abandon in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

extendedOperation

public org.ldaptive.Response<?> extendedOperation(org.ldaptive.extended.ExtendedRequest request)
                                           throws org.ldaptive.LdapException

Specified by:
extendedOperation in interface org.ldaptive.provider.ProviderConnection
Throws:
org.ldaptive.LdapException

addUnsolicitedNotificationListener

public void addUnsolicitedNotificationListener(org.ldaptive.extended.UnsolicitedNotificationListener listener)

Specified by:
addUnsolicitedNotificationListener in interface org.ldaptive.provider.ProviderConnection

removeUnsolicitedNotificationListener

public void removeUnsolicitedNotificationListener(org.ldaptive.extended.UnsolicitedNotificationListener listener)

Specified by:
removeUnsolicitedNotificationListener in interface org.ldaptive.provider.ProviderConnection

createResponse

protected <T> org.ldaptive.Response<T> createResponse(org.ldaptive.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 controls
result - of the operation
ldapResult - provider result
Returns:
operation response

processErrorResultException

protected void processErrorResultException(org.ldaptive.Request request,
                                           org.forgerock.opendj.ldap.ErrorResultException e)
                                    throws org.ldaptive.LdapException
Determines if the supplied error result exception should result in an operation retry.

Parameters:
request - that produced the exception
e - that was produced
Throws:
org.ldaptive.LdapException - wrapping the error result exception


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.