Package com.netscape.certsrv.ldap
Class LdapConnFactory
java.lang.Object
com.netscape.certsrv.ldap.LdapConnFactory
- Direct Known Subclasses:
LdapAnonConnFactory
,LdapBoundConnFactory
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract int
freeConn()
Returns the number of free connections available from this pool.abstract netscape.ldap.LDAPConnection
getConn()
Request access to a Ldap connection from the pool.abstract int
maxConn()
Returns the maximum number of connections available from this pool.abstract void
reset()
Used for disconnecting all connections.abstract void
returnConn
(netscape.ldap.LDAPConnection conn) Return connection to the factory.void
setCMSEngine
(CMSEngine engine) abstract int
Returns the number of total connections available from this pool.
-
Field Details
-
engine
-
-
Constructor Details
-
LdapConnFactory
public LdapConnFactory()
-
-
Method Details
-
getCMSEngine
-
setCMSEngine
-
reset
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
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
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.
-