public class LDAPConnectionPool extends Object
Constructor and Description |
---|
LDAPConnectionPool() |
Modifier and Type | Method and Description |
---|---|
void |
addReferralAuthenticationListener(ReferralAuthenticationListener listener)
Adds a referral authentication listener.
|
InitialLdapContext |
getConnection(LDAPURL ldapUrl)
Returns an LDAPConnection for accessing the specified url.
|
int |
getConnectTimeout()
Returns the timeout to establish the connection in milliseconds.
|
ApplicationTrustManager |
getTrustManager()
Returns the ApplicationTrustManager used by the connection pool to
connect to servers.
|
boolean |
isConnectionRegistered(InitialLdapContext ctx)
Returns
true if the connection passed is registered in the
connection pool, false otherwise. |
static LDAPURL |
makeLDAPUrl(InitialLdapContext ctx,
String dn)
Make an url from the specified arguments.
|
static LDAPURL |
makeLDAPUrl(LDAPURL url,
String dn)
Make an url from the specified arguments.
|
void |
registerConnection(InitialLdapContext ctx)
Registers a connection in this connection pool.
|
void |
releaseConnection(InitialLdapContext ctx)
Release an LDAPConnection created by getConnection().
|
void |
setConnectTimeout(int connectTimeout)
Sets the timeout to establish the connection in milliseconds.
|
void |
setRequestControls(Control[] ctls)
Sets the request controls to be used by the connections of this connection
pool.
|
void |
setTrustManager(ApplicationTrustManager trustManager)
Sets the ApplicationTrustManager used by the connection pool to
connect to servers.
|
void |
unregisterConnection(InitialLdapContext ctx)
Unregisters a connection from this connection pool.
|
public LDAPConnectionPool()
public boolean isConnectionRegistered(InitialLdapContext ctx)
true
if the connection passed is registered in the
connection pool, false
otherwise.ctx
- the connection.true
if the connection passed is registered in the
connection pool, false
otherwise.public void registerConnection(InitialLdapContext ctx)
ctx
- the connection to be registered.public void unregisterConnection(InitialLdapContext ctx) throws NamingException
ctx
- the connection to be unregistered.NamingException
- if there is a problem unregistering the connection.public void addReferralAuthenticationListener(ReferralAuthenticationListener listener)
listener
- the referral authentication listener.public InitialLdapContext getConnection(LDAPURL ldapUrl) throws NamingException
ldapUrl
- the LDAP URL to which the connection must connect.NamingException
- if there was an error connecting.public void setRequestControls(Control[] ctls) throws NamingException
ctls
- the request controls.NamingException
- if an error occurs updating the connections.public void releaseConnection(InitialLdapContext ctx)
ctx
- the connection to be released.public void setTrustManager(ApplicationTrustManager trustManager)
trustManager
- the ApplicationTrustManager.public ApplicationTrustManager getTrustManager()
public int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
0
to express no timeout.connectTimeout
- the timeout to establish the connection in
milliseconds.
Use 0
to express no timeout.public static LDAPURL makeLDAPUrl(InitialLdapContext ctx, String dn)
ctx
- the connection to the server.dn
- the base DN of the URL.public static LDAPURL makeLDAPUrl(LDAPURL url, String dn)
url
- an LDAP URL to use as base of the new LDAP URL.dn
- the base DN for the new LDAP URL.Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.