Interface ILdapConnFactory

  • All Known Implementing Classes:
    LdapAnonConnFactory, LdapBoundConnFactory

    public interface ILdapConnFactory
    Maintains a pool of connections to the LDAP server. Multiple threads use this interface to utilize and release the Ldap connection resources.
    Version:
    $Revision$, $Date$
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int freeConn()
      Returns the number of free connections available from this pool.
      netscape.ldap.LDAPConnection getConn()
      Request access to a Ldap connection from the pool.
      int maxConn()
      Returns the maximum number of connections available from this pool.
      void reset()
      Used for disconnecting all connections.
      void returnConn​(netscape.ldap.LDAPConnection conn)
      Return connection to the factory.
      int totalConn()
      Returns the number of total connections available from this pool.
    • Method Detail

      • reset

        void reset()
            throws ELdapException
        Used for disconnecting all connections. Used just before a subsystem shutdown or process exit.
        Throws:
        EldapException - on Ldap failure when closing connections.
        ELdapException
      • freeConn

        int freeConn()
        Returns the number of free connections available from this pool.
        Returns:
        Integer number of free connections.
      • totalConn

        int totalConn()
        Returns the number of total connections available from this pool. Includes sum of free and in use connections.
        Returns:
        Integer number of total connections.
      • maxConn

        int maxConn()
        Returns the maximum number of connections available from this pool.
        Returns:
        Integer maximum number of connections.
      • getConn

        netscape.ldap.LDAPConnection getConn()
                                      throws ELdapException
        Request access to a Ldap connection from the pool.
        Returns:
        Ldap connection object. connection is not available
        Throws:
        ELdapException - if any error occurs, such as a
      • returnConn

        void returnConn​(netscape.ldap.LDAPConnection conn)
                 throws ELdapException
        Return connection to the factory. mandatory after a getConn().
        Parameters:
        conn - Ldap connection object to be returned to the free list of the pool.
        Throws:
        ELdapException - On any failure to return the connection.