public class ConnectionWrapper extends Object implements Closeable
You can either:
getLdapContext()
method to obtain an InitialLdapContext
for JNDI.getConnection()
method to obtain a Connection
object.Constructor and Description |
---|
ConnectionWrapper(HostPort hostPort,
PreferredConnection.Type connectionType,
String bindDn,
String bindPwd,
int connectTimeout,
TrustManager trustManager)
Creates a connection wrapper.
|
ConnectionWrapper(HostPort hostPort,
PreferredConnection.Type connectionType,
String bindDn,
String bindPwd,
int connectTimeout,
TrustManager trustManager,
KeyManager keyManager)
Creates a connection wrapper.
|
ConnectionWrapper(String ldapUrl,
PreferredConnection.Type connectionType,
String bindDn,
String bindPwd,
int connectTimeout,
ApplicationTrustManager trustManager)
Creates a connection wrapper.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Connection |
getConnection()
Returns the connection.
|
HostPort |
getHostPort()
Returns the host name and port number of this connection.
|
InitialLdapContext |
getLdapContext()
Returns the ldap context (JNDI).
|
RootCfgClient |
getRootConfiguration()
Returns the root configuration client by using the inrnal Connection.
|
public ConnectionWrapper(String ldapUrl, PreferredConnection.Type connectionType, String bindDn, String bindPwd, int connectTimeout, ApplicationTrustManager trustManager) throws NamingException
ldapUrl
- the ldap URL containing the host name and port number to connect toconnectionType
- the type of connection (LDAP, LDAPS, START_TLS)bindDn
- the bind DNbindPwd
- the bind passwordconnectTimeout
- connect timeout to use for the connectiontrustManager
- trust manager to use for a secure connectionNamingException
- If an error occurspublic ConnectionWrapper(HostPort hostPort, PreferredConnection.Type connectionType, String bindDn, String bindPwd, int connectTimeout, TrustManager trustManager) throws NamingException
hostPort
- the host name and port number to connect toconnectionType
- the type of connection (LDAP, LDAPS, START_TLS)bindDn
- the bind DNbindPwd
- the bind passwordconnectTimeout
- connect timeout to use for the connectiontrustManager
- trust manager to use for a secure connectionNamingException
- If an error occurspublic ConnectionWrapper(HostPort hostPort, PreferredConnection.Type connectionType, String bindDn, String bindPwd, int connectTimeout, TrustManager trustManager, KeyManager keyManager) throws NamingException
hostPort
- the host name and port number to connect toconnectionType
- the type of connection (LDAP, LDAPS, START_TLS)bindDn
- the bind DNbindPwd
- the bind passwordconnectTimeout
- connect timeout to use for the connectiontrustManager
- trust manager to use for a secure connectionkeyManager
- key manager to use for a secure connectionNamingException
- If an error occurspublic Connection getConnection()
public InitialLdapContext getLdapContext()
public HostPort getHostPort()
public RootCfgClient getRootConfiguration()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright 2010-2017 ForgeRock AS.