public class SimpleLdapConnectionManager extends Object implements LdapConnectionManager
LDAPConnectionsLdapConnectionManagerConfig| Modifier and Type | Field and Description |
|---|---|
static String |
KEYSTORE_LOCATION_SYS_PROP_KEY |
static String |
KEYSTORE_PASSWORD_SYS_PROP_KEY |
| Constructor and Description |
|---|
SimpleLdapConnectionManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyConstraints(com.novell.ldap.LDAPConnection conn)
Applies
LDAPConstraints
to the specified LDAPConnection. |
protected void |
connect(com.novell.ldap.LDAPConnection conn)
Connects the specified
LDAPConnection to
the currently configured host and port. |
void |
destroy()
Shuts down an instance.
|
com.novell.ldap.LDAPConnection |
getBoundConnection(String dn,
String pw)
Retrieve a bound
LDAPConnection using the indicated credentials |
LdapConnectionManagerConfig |
getConfig()
Retrieve the currently assigned
LdapConnectionManagerConfig. |
com.novell.ldap.LDAPConnection |
getConnection()
Retrieve an
LDAPConnection -- the connection may
already be bound depending on the configuration |
void |
init()
Initializes an instance for use, typically
by digesting the contents of the assigned
LdapConnectionManagerConfig. |
protected void |
initKeystoreLocation()
Caches a keystore location as a system property.
|
protected void |
initKeystorePassword()
Caches a keystore password as a system property.
|
protected boolean |
isTlsSocketFactory() |
protected com.novell.ldap.LDAPConnection |
newConnection() |
protected void |
postConnect(com.novell.ldap.LDAPConnection conn) |
void |
returnConnection(com.novell.ldap.LDAPConnection conn)
Return an
LDAPConnection. |
void |
setConfig(LdapConnectionManagerConfig config)
Assign the LDAPConnection management configuration.
|
public static final String KEYSTORE_LOCATION_SYS_PROP_KEY
public static final String KEYSTORE_PASSWORD_SYS_PROP_KEY
public void init()
LdapConnectionManagerConfig. Usually
called by Spring.init in interface LdapConnectionManagerpublic com.novell.ldap.LDAPConnection getConnection()
throws com.novell.ldap.LDAPException
LDAPConnection -- the connection may
already be bound depending on the configurationgetConnection in interface LdapConnectionManagerLDAPConnectioncom.novell.ldap.LDAPException - if the LDAPConnection allocation failspublic com.novell.ldap.LDAPConnection getBoundConnection(String dn, String pw) throws com.novell.ldap.LDAPException
LDAPConnection using the indicated credentialsgetBoundConnection in interface LdapConnectionManagerdn - the distringuished name for bindingpw - the password for bindingLDAPConnectioncom.novell.ldap.LDAPException - if the LDAPConnection allocation failsprotected com.novell.ldap.LDAPConnection newConnection()
throws com.novell.ldap.LDAPException
com.novell.ldap.LDAPExceptionpublic void returnConnection(com.novell.ldap.LDAPConnection conn)
LDAPConnection. This can allow for
connections to be pooled instead of just destroyed.returnConnection in interface LdapConnectionManagerconn - an LDAPConnection that you no longer needpublic void setConfig(LdapConnectionManagerConfig config)
setConfig in interface LdapConnectionManagerconfig - a reference to a LdapConnectionManagerConfig. Should be cacheable without defensive copying.public LdapConnectionManagerConfig getConfig()
LdapConnectionManagerConfig.getConfig in interface LdapConnectionManagerLdapConnectionManagerConfig, if anyprotected void initKeystorePassword()
KEYSTORE_PASSWORD_SYS_PROP_KEY system property
has a non-null value. Otherwise caches the
keystore password from the currently assigned
LdapConnectionManagerConfig.config - NullPointerException - if a non-null keystore password
cannot be resolvedprotected void initKeystoreLocation()
KEYSTORE_LOCATION_SYS_PROP_KEY system property
has a non-null value. Otherwise caches the
keystore location from the currently assigned
LdapConnectionManagerConfig.config - NullPointerException - if a non-null keystore location
cannot be resolvedprotected void applyConstraints(com.novell.ldap.LDAPConnection conn)
LDAPConstraints
to the specified LDAPConnection.
Implemented to assign timeLimit and
referralFollowing constraint values
retrieved from the currently assigned
LdapConnectionManagerConfig.conn - protected void connect(com.novell.ldap.LDAPConnection conn)
throws com.novell.ldap.LDAPException
LDAPConnection to
the currently configured host and port.conn - an LDAPConnectioncom.novell.ldap.LDAPConnection - if the connect attempt failscom.novell.ldap.LDAPExceptionprotected void postConnect(com.novell.ldap.LDAPConnection conn)
throws com.novell.ldap.LDAPException
com.novell.ldap.LDAPExceptionprotected boolean isTlsSocketFactory()
public void destroy()
destroy in interface LdapConnectionManagerCopyright © 2003–2022 Sakai Project. All rights reserved.