public class LDAPConnectionPool extends Object
Constructor and Description |
---|
LDAPConnectionPool() |
Modifier and Type | Method and Description |
---|---|
void |
addReferralAuthenticationListener(ReferralAuthenticationListener listener)
Adds a referral authentication listener.
|
ConnectionWithControls |
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(ConnectionWrapper conn)
Returns whether the connection passed is registered in the connection pool.
|
static LDAPURL |
makeLDAPUrl(HostPort hostPort,
String dn,
boolean isLdaps)
Make an url from the specified arguments.
|
static LDAPURL |
makeLDAPUrl(LDAPURL url,
String dn)
Make an url from the specified arguments.
|
void |
registerConnection(ConnectionWrapper conn)
Registers a connection in this connection pool.
|
void |
releaseConnection(ConnectionWithControls conn)
Release an LDAPConnection created by getConnection().
|
void |
setConnectTimeout(int connectTimeout)
Sets the timeout to establish the connection in milliseconds.
|
void |
setRequestControls(org.forgerock.opendj.ldap.controls.ServerSideSortRequestControl sortControl,
org.forgerock.opendj.ldap.controls.ManageDsaItRequestControl followReferralsControl)
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(ConnectionWrapper conn)
Unregisters a connection from this connection pool.
|
public LDAPConnectionPool()
public boolean isConnectionRegistered(ConnectionWrapper conn)
conn
- the connection.true
if the connection passed is registered in the connection pool,
false
otherwise.public void registerConnection(ConnectionWrapper conn)
conn
- the connection to be registered.public void unregisterConnection(ConnectionWrapper conn) throws org.forgerock.opendj.ldap.LdapException
conn
- the connection to be unregistered.org.forgerock.opendj.ldap.LdapException
- if there is a problem unregistering the connection.public void addReferralAuthenticationListener(ReferralAuthenticationListener listener)
listener
- the referral authentication listener.public ConnectionWithControls getConnection(LDAPURL ldapUrl) throws org.forgerock.opendj.ldap.LdapException
ldapUrl
- the LDAP URL to which the connection must connect.org.forgerock.opendj.ldap.LdapException
- if there was an error connecting.public void setRequestControls(org.forgerock.opendj.ldap.controls.ServerSideSortRequestControl sortControl, org.forgerock.opendj.ldap.controls.ManageDsaItRequestControl followReferralsControl)
sortControl
- the sort control.followReferralsControl
- the manage dsa it control.public void releaseConnection(ConnectionWithControls conn)
conn
- 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(HostPort hostPort, String dn, boolean isLdaps)
hostPort
- the host name and port of the server.dn
- the base DN of the URL.isLdaps
- whether the connection uses LDAPSpublic 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-2017 ForgeRock AS. All Rights Reserved.