com.netscape.certsrv.ldap
Interface ILdapConnFactory

All Known Subinterfaces:
ILdapBoundConnFactory

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: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Method Summary
 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.
 void init(IConfigStore config)
          Initialize the poll from the config store.
 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

init

void init(IConfigStore config)
          throws EBaseException,
                 ELdapException
Initialize the poll from the config store.

Parameters:
config - The configuration substore.
Throws:
EBaseException - On configuration error.
ELdapException - On all other errors.

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.