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,
ConnectionSecurity connectionSecurity,
Dn bindDn,
String bindPwd,
int connectTimeout,
TrustManager trustManager)
Creates a connection wrapper.
|
ConnectionWrapper(HostPort hostPort,
ConnectionSecurity connectionSecurity,
Dn bindDn,
String bindPwd,
int connectTimeout,
TrustManager trustManager,
KeyManager keyManager)
Creates a connection wrapper.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Dn |
getBindDn()
Returns the bind DN used by this connection.
|
String |
getBindPassword()
Returns the bind password used by this connection.
|
Connection |
getConnection()
Returns the connection.
|
ConnectionSecurity |
getConnectionSecurity()
Returns the connection security used by this connection wrapper.
|
HostPort |
getHostPort()
Returns the host name and port number of this connection.
|
String |
getLdapUrl()
Returns the LDAP URL used by this connection.
|
RootCfgClient |
getRootConfiguration()
Returns the root configuration client by using the inrnal Connection.
|
String |
toString() |
public ConnectionWrapper(HostPort hostPort, ConnectionSecurity connectionSecurity, Dn bindDn, String bindPwd, int connectTimeout, TrustManager trustManager) throws LdapException
hostPort
- the host name and port number to connect toconnectionSecurity
- the connection securitybindDn
- the bind DNbindPwd
- the bind passwordconnectTimeout
- connect timeout to use for the connectiontrustManager
- trust manager to use for a secure connectionLdapException
- If an error occurspublic ConnectionWrapper(HostPort hostPort, ConnectionSecurity connectionSecurity, Dn bindDn, String bindPwd, int connectTimeout, TrustManager trustManager, KeyManager keyManager) throws LdapException
hostPort
- the host name and port number to connect toconnectionSecurity
- the connection securitybindDn
- 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 connectionLdapException
- If an error occurspublic Dn getBindDn()
public String getBindPassword()
public String getLdapUrl()
public Connection getConnection()
public ConnectionSecurity getConnectionSecurity()
public HostPort getHostPort()
public RootCfgClient getRootConfiguration()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright 2010-2018 ForgeRock AS.