public class PoolingLdapConnectionManager extends SimpleLdapConnectionManager
LDAPConnections.
Uses commons-pool to provide a pool of connections instead of creating a new
connection for each request. Originally tried implementing this with
om.novell.ldap.connectionpool.PoolManager, but it did not handle
recovering connections that had suffered a network error or connections that
were never returned but dropped out of scope.LdapConnectionManagerConfig,
PooledLDAPConnection,
PooledLDAPConnectionFactoryKEYSTORE_LOCATION_SYS_PROP_KEY, KEYSTORE_PASSWORD_SYS_PROP_KEY| Constructor and Description |
|---|
PoolingLdapConnectionManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Shuts down an instance.
|
com.novell.ldap.LDAPConnection |
getBoundConnection(String dn,
String pw)
Retrieve a bound
LDAPConnection using the indicated credentials |
com.novell.ldap.LDAPConnection |
getConnection()
Retrieve an
LDAPConnection -- the connection may
already be bound depending on the configuration |
PooledLDAPConnectionFactory |
getFactory() |
void |
init()
Initializes an instance for use, typically
by digesting the contents of the assigned
LdapConnectionManagerConfig. |
void |
returnConnection(com.novell.ldap.LDAPConnection conn)
Return an
LDAPConnection. |
void |
setFactory(PooledLDAPConnectionFactory factory) |
protected void |
setPool(org.apache.commons.pool.ObjectPool pool)
Assign a pool implementation.
|
applyConstraints, connect, getConfig, initKeystoreLocation, initKeystorePassword, isTlsSocketFactory, newConnection, postConnect, setConfigpublic void init()
LdapConnectionManagerConfig. Usually
called by Spring.init in interface LdapConnectionManagerinit in class SimpleLdapConnectionManagerpublic com.novell.ldap.LDAPConnection getConnection()
throws com.novell.ldap.LDAPException
LDAPConnection -- the connection may
already be bound depending on the configurationgetConnection in interface LdapConnectionManagergetConnection in class SimpleLdapConnectionManagerLDAPConnectioncom.novell.ldap.LDAPException - if the LDAPConnection allocation failspublic com.novell.ldap.LDAPConnection getBoundConnection(String dn, String pw) throws com.novell.ldap.LDAPException
SimpleLdapConnectionManagerLDAPConnection using the indicated credentialsgetBoundConnection in interface LdapConnectionManagergetBoundConnection in class SimpleLdapConnectionManagerdn - the distringuished name for bindingpw - the password for bindingLDAPConnectioncom.novell.ldap.LDAPException - if the LDAPConnection allocation failspublic void returnConnection(com.novell.ldap.LDAPConnection conn)
LDAPConnection. This can allow for
connections to be pooled instead of just destroyed.returnConnection in interface LdapConnectionManagerreturnConnection in class SimpleLdapConnectionManagerconn - an LDAPConnection that you no longer needpublic void destroy()
destroy in interface LdapConnectionManagerdestroy in class SimpleLdapConnectionManagerpublic PooledLDAPConnectionFactory getFactory()
public void setFactory(PooledLDAPConnectionFactory factory)
protected void setPool(org.apache.commons.pool.ObjectPool pool)
init(). If specified,
setFactory(PooledLDAPConnectionFactory) will have
no effect.
This method exists almost entirely for testing purposes.
pool - the pool to cache; accepts nullCopyright © 2003–2022 Sakai Project. All rights reserved.