Class AbstractPoolableLdapConnectionFactory

    • Method Detail

      • destroyObject

        public void destroyObject​(org.apache.commons.pool2.PooledObject<LdapConnection> connection)
                           throws LdapException
        Destroying a connection will unbind it which will result on a shutdown of teh underlying protocol.
        Specified by:
        destroyObject in interface org.apache.commons.pool2.PooledObjectFactory<LdapConnection>
        Throws:
        LdapException
      • getLdapApiService

        public LdapApiService getLdapApiService()
        Returns the LdapApiService instance used by this factory.
        Returns:
        The LdapApiService instance used by this factory
      • makeObject

        public org.apache.commons.pool2.PooledObject<LdapConnectionmakeObject()
                                                                         throws LdapException
        Specifically, we are creating a new connection based on the LdapConnection Factory we used to create this pool of connections. The default is to create bound connections.
        Specified by:
        makeObject in interface org.apache.commons.pool2.PooledObjectFactory<LdapConnection>
        Throws:
        LdapException - If unable to connect.
      • passivateObject

        public void passivateObject​(org.apache.commons.pool2.PooledObject<LdapConnection> connection)
                             throws LdapException
        We don't do anything with the connection. It remains in the state it was before being used.
        Specified by:
        passivateObject in interface org.apache.commons.pool2.PooledObjectFactory<LdapConnection>
        Throws:
        LdapException - If unable to reconfigure and rebind.
      • setValidator

        public void setValidator​(LdapConnectionValidator validator)
        Sets the validator to use when validation occurs. Note that validation will only occur if the connection pool was configured to validate. This means one of:
        • setTestOnBorrow
        • setTestWhileIdle
        • setTestOnReturn
        must have been set to true on the pool. The default validator is LookupLdapConnectionValidator.
        Parameters:
        validator - The validator
      • validateObject

        public boolean validateObject​(org.apache.commons.pool2.PooledObject<LdapConnection> connection)
        Validating a connection is done by checking the connection status.
        Specified by:
        validateObject in interface org.apache.commons.pool2.PooledObjectFactory<LdapConnection>