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 Details

    • logger

      public static org.slf4j.Logger logger
    • PROP_MINCONNS

      public static final String PROP_MINCONNS
      See Also:
    • PROP_MAXCONNS

      public static final String PROP_MAXCONNS
      See Also:
    • PROP_MAXRESULTS

      public static final String PROP_MAXRESULTS
      See Also:
    • PROP_ERROR_IF_DOWN

      public static final String PROP_ERROR_IF_DOWN
      See Also:
    • id

      protected String id
    • config

      protected PKISocketConfig config
    • mConnInfo

      protected LdapConnInfo mConnInfo
    • mMinConns

      protected int mMinConns
    • mMaxConns

      protected int mMaxConns
    • mMaxResults

      protected int mMaxResults
    • mNumConns

      protected int mNumConns
      number of available conns in array
    • mTotal

      protected int mTotal
      total num conns
    • mErrorIfDown

      protected boolean mErrorIfDown
      return error if server is down at creation time.
    • mDefErrorIfDown

      protected boolean mDefErrorIfDown
      default value for the above at init time.
    • auditor

      protected Auditor auditor
    • socketListener

      protected org.mozilla.jss.ssl.SSLSocketListener socketListener
    • approvalCallback

      protected org.mozilla.jss.ssl.SSLCertificateApprovalCallback approvalCallback
  • Constructor Details

    • LdapConnFactory

      public LdapConnFactory()
  • Method Details

    • getConnInfo

      public LdapConnInfo getConnInfo()
      returns connection info.
    • getAuditor

      public Auditor getAuditor()
    • setAuditor

      public void setAuditor(Auditor auditor)
    • getSocketListener

      public org.mozilla.jss.ssl.SSLSocketListener getSocketListener()
    • setSocketListener

      public void setSocketListener(org.mozilla.jss.ssl.SSLSocketListener socketListener)
    • getApprovalCallback

      public org.mozilla.jss.ssl.SSLCertificateApprovalCallback getApprovalCallback()
    • setApprovalCallback

      public void setApprovalCallback(org.mozilla.jss.ssl.SSLCertificateApprovalCallback approvalCallback)
    • reset

      public abstract void reset() throws ELdapException
      Used for disconnecting all connections. Used just before a subsystem shutdown or process exit.
    • freeConn

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

      public 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 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.
    • finalize

      protected void finalize() throws Exception
      Overrides:
      finalize in class Object
      Throws:
      Exception