Interface LdapConnectionFactory

All Known Implementing Classes:
DefaultLdapConnectionFactory

public interface LdapConnectionFactory
A factory that creates LdapConnection objects using the provided LdapConnectionConfig.
Author:
Apache Directory Project
  • Method Summary

    Modifier and Type
    Method
    Description
    Issues a bind request on the supplied connection using the name and credentials from the LdapConnectionConfg supplied to the constructor.
    Applies the following configuration settings from the LdapConnectionConfig to the supplied connection: timeOut binaryAttributeDetector This method is called by newLdapConnection, so there is no need to call this on a newly created connection.
    org.apache.directory.api.ldap.codec.api.LdapApiService
    Returns the LdapApiService instance used by this factory.
    Returns a newly created, configured, and authenticated connection.
    Returns a newly created connection, that has not been bound (bind) that otherwise respects LdapConnectionConfig supplied to the constructor.
  • Method Details

    • bindConnection

      LdapConnection bindConnection(LdapConnection connection) throws org.apache.directory.api.ldap.model.exception.LdapException
      Issues a bind request on the supplied connection using the name and credentials from the LdapConnectionConfg supplied to the constructor. Returns the connection supplied for chaining.
      Parameters:
      connection - The connection to bind with the configuration credentials.
      Returns:
      The connection supplied.
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - If the bind fails.
    • configureConnection

      LdapConnection configureConnection(LdapConnection connection)
      Applies the following configuration settings from the LdapConnectionConfig to the supplied connection:
      • timeOut
      • binaryAttributeDetector
      This method is called by newLdapConnection, so there is no need to call this on a newly created connection. This should be used for pooling where the returned connection could have been modified by the borrower in order to ensure the next borrower gets a correctly configured connection. Returns the supplied connection for chaining.
      Parameters:
      connection - The connection to configure
      Returns:
      The supplied connection.
    • getLdapApiService

      org.apache.directory.api.ldap.codec.api.LdapApiService getLdapApiService()
      Returns the LdapApiService instance used by this factory.
      Returns:
      The LdapApiService instance used by this factory
    • newLdapConnection

      LdapConnection newLdapConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
      Returns a newly created, configured, and authenticated connection. This method should be used by a connection pool to manufacture the pooled instances.
      Returns:
      A newly created, configured, and authenticated LdapConnection.
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - If the new connection couldn't be established
    • newUnboundLdapConnection

      LdapConnection newUnboundLdapConnection()
      Returns a newly created connection, that has not been bound (bind) that otherwise respects LdapConnectionConfig supplied to the constructor. This is useful for authentication purposes where the consumer will use a bind operation.
      Returns:
      A newly created and configured LdapConnection.