Class LdapConnectionPool

    • Constructor Detail

      • LdapConnectionPool

        public LdapConnectionPool​(LdapConnectionConfig connectionConfig,
                                  LdapApiService apiService,
                                  long timeout)
        Instantiates a new LDAP connection pool.
        Parameters:
        connectionConfig - The connection configuration
        apiService - The api service (codec)
        timeout - The connection timeout in millis
      • LdapConnectionPool

        public LdapConnectionPool​(LdapConnectionConfig connectionConfig,
                                  LdapApiService apiService,
                                  long timeout,
                                  GenericObjectPoolConfig poolConfig)
        Instantiates a new LDAP connection pool.
        Parameters:
        connectionConfig - The connection configuration
        apiService - The api service (codec)
        timeout - The connection timeout in millis
        poolConfig - The pool configuration
      • LdapConnectionPool

        public LdapConnectionPool​(PooledObjectFactory<LdapConnection> factory)
        Instantiates a new LDAP connection pool.
        Parameters:
        factory - The LDAP connection factory
    • Method Detail

      • getLdapApiService

        public LdapApiService getLdapApiService()
        Returns the LdapApiService instance used by this connection pool.
        Returns:
        The LdapApiService instance used by this connection pool.
      • getConnection

        public LdapConnection getConnection()
                                     throws LdapException
        Gives a LdapConnection fetched from the pool.
        Returns:
        an LdapConnection object from pool
        Throws:
        LdapException - if an error occurs while obtaining a connection from the factory
      • releaseConnection

        public void releaseConnection​(LdapConnection connection)
                               throws LdapException
        Places the given LdapConnection back in the pool.
        Parameters:
        connection - the LdapConnection to be released
        Throws:
        LdapException - if an error occurs while releasing the connection