public class ConnectionData extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DSML |
static String |
LDAP
Which protocol to use (currently "ldap", "dsml", "ssl")
|
| Constructor and Description |
|---|
ConnectionData()
Empty constructor - data fields are intended to be set directly.
|
ConnectionData(int version,
String url,
String userDN,
char[] pwd,
boolean tracing,
String referralType,
String aliasType)
I18nUtility method for test routines
|
ConnectionData(int version,
String url,
String userDN,
char[] pwd,
boolean tracing,
String referralType,
String aliasType,
boolean useSSL,
String cacerts,
String clientcerts,
char[] caKeystorePwd,
char[] clientKeystorePwd,
String caKeystoreType,
String clientKeystoreType,
boolean useGSSAPI,
Properties extraProperties)
This sets up a full connection data object with the information needed to create a jndi environment properties
object.
|
ConnectionData(LDAPConfigProxyItem config) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkData()
This method confirms that the data entered in the ConnectionData object is consistent, complete and valid.
|
void |
clearPasswords()
This should be used to clear all the passwords saved in this data object when they have been used and are no
longer needed...
|
char[] |
getCredentials() |
String |
getHost()
Gets the host name from the url string.
|
Hashtable |
getJNDIEnvironment()
This returns the connection data as a jndi env object suitable for use in opening a directory context.
|
List<Hashtable<String,String>> |
getLDAPEnvironments() |
int |
getMaxRetries() |
int |
getMaxSize() |
int |
getMinFailbackTime() |
int |
getPort()
Gets the port number from the url string.
|
String |
getRootDN() |
String |
getURL() |
String |
getUserDN() |
void |
putExtraProperty(String key,
String property) |
void |
setProtocol(String newProtocol) |
static void |
setupBasicProperties(Hashtable env,
String url,
boolean tracing,
String referralType,
String aliasType) |
static void |
setupSimpleSecurityProperties(Hashtable env,
String userDN,
char[] pwd)
This sets the environment properties needed for a simple username + password authenticated jndi connection.
|
static void |
setupSSLProperties(Hashtable env,
String cacerts,
String clientcerts,
char[] caKeystorePwd,
char[] clientKeystorePwd,
String caKeystoreType,
String clientKeystoreType,
boolean sslTracing,
String sslSocketFactory) |
void |
setURL(String URL)
Sets the url from the host & port, e.g.
|
void |
setURL(String host,
int port)
Sets the url from the host & port, e.g.
|
String |
toString()
Returns this data object as a string (doesn't include passwords)..
|
public static final String LDAP
public static final String DSML
public ConnectionData()
public ConnectionData(LDAPConfigProxyItem config) throws NamingException
NamingExceptionpublic ConnectionData(int version,
String url,
String userDN,
char[] pwd,
boolean tracing,
String referralType,
String aliasType,
boolean useSSL,
String cacerts,
String clientcerts,
char[] caKeystorePwd,
char[] clientKeystorePwd,
String caKeystoreType,
String clientKeystoreType,
boolean useGSSAPI,
Properties extraProperties)
version - url - userDN - pwd - tracing - referralType - aliasType - useSSL - cacerts - clientcerts - caKeystorePwd - clientKeystorePwd - caKeystoreType - clientKeystoreType - useGSSAPI - whether to use the GSSAPI protocol (e.g. for Kerberos support)extraProperties - a 'get out of jail free' for any bizarre properties that haven't already been covered, or that are
introduced in the future. Using this isn't really good coding practice, since we don't know what there
properties are, but is sometimes required...public void setProtocol(String newProtocol)
public void clearPasswords()
public void setURL(String host, int port)
host - the host name to connect to, e.g. schmiedefix or 192.168.145.138.port - the host port to connect to, e.g. 389.public void setURL(String URL)
URL - The full URL to connect topublic String getURL()
public String getUserDN()
public String getHost()
public int getPort()
public String getRootDN()
public String toString()
public Hashtable getJNDIEnvironment() throws NamingException
NamingException - a large range of exceptions, ranging from invalid data through to problems setting up the SSL
connection.public void checkData()
throws NamingException
NamingException - thrown if the data is inconsistent or incomplete.public static void setupBasicProperties(Hashtable env, String url, boolean tracing, String referralType, String aliasType) throws NamingException
NamingExceptionpublic static void setupSimpleSecurityProperties(Hashtable env, String userDN, char[] pwd)
env - userDN - pwd - public static void setupSSLProperties(Hashtable env, String cacerts, String clientcerts, char[] caKeystorePwd, char[] clientKeystorePwd, String caKeystoreType, String clientKeystoreType, boolean sslTracing, String sslSocketFactory) throws NamingException
NamingExceptionpublic int getMinFailbackTime()
public int getMaxRetries()
public int getMaxSize()
public char[] getCredentials()
Copyright © 2017 SAP SE. All Rights Reserved.