Class LdapConnFactory

java.lang.Object
com.netscape.certsrv.ldap.LdapConnFactory
Direct Known Subclasses:
LdapAnonConnFactory, LdapBoundConnFactory

public abstract class LdapConnFactory extends Object
Maintains a pool of connections to the LDAP server. Multiple threads use this interface to utilize and release the Ldap connection resources.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected CMSEngine
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    Returns the number of free connections available from this pool.
     
    abstract netscape.ldap.LDAPConnection
    Request access to a Ldap connection from the pool.
    abstract int
    Returns the maximum number of connections available from this pool.
    abstract void
    Used for disconnecting all connections.
    abstract void
    returnConn(netscape.ldap.LDAPConnection conn)
    Return connection to the factory.
    void
     
    abstract int
    Returns the number of total connections available from this pool.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • LdapConnFactory

      public LdapConnFactory()
  • Method Details

    • getCMSEngine

      public CMSEngine getCMSEngine()
    • setCMSEngine

      public void setCMSEngine(CMSEngine engine)
    • reset

      public abstract 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

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

      public abstract 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

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

      public abstract 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

      public abstract 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.