public class ConnectionData
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DSML |
static java.lang.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,
java.lang.String url,
java.lang.String userDN,
char[] pwd,
boolean tracing,
java.lang.String referralType,
java.lang.String aliasType)
I18nUtility method for test routines
|
ConnectionData(int version,
java.lang.String url,
java.lang.String userDN,
char[] pwd,
boolean tracing,
java.lang.String referralType,
java.lang.String aliasType,
boolean useSSL,
java.lang.String cacerts,
java.lang.String clientcerts,
char[] caKeystorePwd,
char[] clientKeystorePwd,
java.lang.String caKeystoreType,
java.lang.String clientKeystoreType,
boolean useGSSAPI,
java.util.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() |
java.lang.String |
getHost()
Gets the host name from the url string.
|
java.util.Hashtable |
getJNDIEnvironment()
This returns the connection data as a jndi env object suitable for use in opening a directory context.
|
java.util.List<java.util.Hashtable<java.lang.String,java.lang.String>> |
getLDAPEnvironments() |
int |
getMaxRetries() |
int |
getMaxSize() |
int |
getMinFailbackTime() |
int |
getPort()
Gets the port number from the url string.
|
java.lang.String |
getRootDN() |
java.lang.String |
getURL() |
java.lang.String |
getUserDN() |
void |
putExtraProperty(java.lang.String key,
java.lang.String property) |
void |
setProtocol(java.lang.String newProtocol) |
static void |
setupBasicProperties(java.util.Hashtable env,
java.lang.String url,
boolean tracing,
java.lang.String referralType,
java.lang.String aliasType) |
static void |
setupSimpleSecurityProperties(java.util.Hashtable env,
java.lang.String userDN,
char[] pwd)
This sets the environment properties needed for a simple username + password authenticated jndi connection.
|
static void |
setupSSLProperties(java.util.Hashtable env,
java.lang.String cacerts,
java.lang.String clientcerts,
char[] caKeystorePwd,
char[] clientKeystorePwd,
java.lang.String caKeystoreType,
java.lang.String clientKeystoreType,
boolean sslTracing,
java.lang.String sslSocketFactory) |
void |
setURL(java.lang.String URL)
Sets the url from the host & port, e.g.
|
void |
setURL(java.lang.String host,
int port)
Sets the url from the host & port, e.g.
|
java.lang.String |
toString()
Returns this data object as a string (doesn't include passwords)..
|
public static final java.lang.String LDAP
public static final java.lang.String DSML
public ConnectionData()
public ConnectionData(LDAPConfigProxyItem config) throws javax.naming.NamingException
javax.naming.NamingExceptionpublic ConnectionData(int version,
java.lang.String url,
java.lang.String userDN,
char[] pwd,
boolean tracing,
java.lang.String referralType,
java.lang.String aliasType,
boolean useSSL,
java.lang.String cacerts,
java.lang.String clientcerts,
char[] caKeystorePwd,
char[] clientKeystorePwd,
java.lang.String caKeystoreType,
java.lang.String clientKeystoreType,
boolean useGSSAPI,
java.util.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 ConnectionData(int version,
java.lang.String url,
java.lang.String userDN,
char[] pwd,
boolean tracing,
java.lang.String referralType,
java.lang.String aliasType)
version - url - userDN - pwd - tracing - referralType - aliasType - public void setProtocol(java.lang.String newProtocol)
public void clearPasswords()
public void setURL(java.lang.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(java.lang.String URL)
URL - The full URL to connect topublic java.lang.String getURL()
public java.lang.String getUserDN()
public java.lang.String getHost()
public int getPort()
public java.lang.String getRootDN()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Hashtable getJNDIEnvironment()
throws javax.naming.NamingException
javax.naming.NamingException - a large range of exceptions, ranging from invalid data through to problems setting up the SSL
connection.public void checkData()
throws javax.naming.NamingException
javax.naming.NamingException - thrown if the data is inconsistent or incomplete.public void putExtraProperty(java.lang.String key,
java.lang.String property)
public static void setupBasicProperties(java.util.Hashtable env,
java.lang.String url,
boolean tracing,
java.lang.String referralType,
java.lang.String aliasType)
throws javax.naming.NamingException
javax.naming.NamingExceptionpublic static void setupSimpleSecurityProperties(java.util.Hashtable env,
java.lang.String userDN,
char[] pwd)
env - userDN - pwd - public static void setupSSLProperties(java.util.Hashtable env,
java.lang.String cacerts,
java.lang.String clientcerts,
char[] caKeystorePwd,
char[] clientKeystorePwd,
java.lang.String caKeystoreType,
java.lang.String clientKeystoreType,
boolean sslTracing,
java.lang.String sslSocketFactory)
throws javax.naming.NamingException
javax.naming.NamingExceptionpublic int getMinFailbackTime()
public int getMaxRetries()
public int getMaxSize()
public java.util.List<java.util.Hashtable<java.lang.String,java.lang.String>> getLDAPEnvironments()
public char[] getCredentials()
Copyright © 2018 SAP SE. All Rights Reserved.