Class DefaultLdapConnectionFactory

    • Method Detail

      • bindConnection

        public LdapConnection bindConnection​(LdapConnection connection)
                                      throws 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.
        Specified by:
        bindConnection in interface LdapConnectionFactory
        Parameters:
        connection - The connection to bind with the configuration credentials.
        Returns:
        The connection supplied.
        Throws:
        LdapException - If the bind fails.
      • configureConnection

        public 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.
        Specified by:
        configureConnection in interface LdapConnectionFactory
        Parameters:
        connection - The connection to configure
        Returns:
        The supplied connection.
      • newUnboundLdapConnection

        public 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.
        Specified by:
        newUnboundLdapConnection in interface LdapConnectionFactory
        Returns:
        A newly created and configured LdapConnection.
      • setLdapApiService

        public void setLdapApiService​(LdapApiService apiService)
        Sets the LdapApiService (codec) to be used by the connections created by this factory.
        Parameters:
        apiService - The codec to used by connections created by this factory
      • setTimeOut

        public void setTimeOut​(long timeout)
        Sets the timeout that will be used by all connections created by this factory.
        Parameters:
        timeout - The timeout in millis.
        See Also:
        LdapConnection.setTimeOut(long)