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
FieldsModifier and TypeFieldDescriptionprotected org.mozilla.jss.ssl.SSLCertificateApprovalCallback
protected Auditor
protected PKISocketConfig
protected String
static org.slf4j.Logger
protected LdapConnInfo
protected boolean
default value for the above at init time.protected boolean
return error if server is down at creation time.protected int
protected int
protected int
protected int
number of available conns in arrayprotected int
total num connsstatic final String
static final String
static final String
static final String
protected org.mozilla.jss.ssl.SSLSocketListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalize()
int
freeConn()
Returns the number of free connections available from this pool.org.mozilla.jss.ssl.SSLCertificateApprovalCallback
abstract netscape.ldap.LDAPConnection
getConn()
Request access to a Ldap connection from the pool.returns connection info.org.mozilla.jss.ssl.SSLSocketListener
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
setApprovalCallback
(org.mozilla.jss.ssl.SSLCertificateApprovalCallback approvalCallback) void
setAuditor
(Auditor auditor) void
setSocketListener
(org.mozilla.jss.ssl.SSLSocketListener socketListener) int
Returns the number of total connections available from this pool.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
PROP_MINCONNS
- See Also:
-
PROP_MAXCONNS
- See Also:
-
PROP_MAXRESULTS
- See Also:
-
PROP_ERROR_IF_DOWN
- See Also:
-
id
-
config
-
mConnInfo
-
mMinConns
protected int mMinConns -
mMaxConns
protected int mMaxConns -
mMaxResults
protected int mMaxResults -
mNumConns
protected int mNumConnsnumber of available conns in array -
mTotal
protected int mTotaltotal num conns -
mErrorIfDown
protected boolean mErrorIfDownreturn error if server is down at creation time. -
mDefErrorIfDown
protected boolean mDefErrorIfDowndefault value for the above at init time. -
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
returns connection info. -
getAuditor
-
setAuditor
-
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
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
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.
-
finalize
-