public class LdapConnectionConfig
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private BinaryAttributeDetector |
binaryAttributeDetector
The class used to detect if an attribute is HR or not
|
private java.lang.String |
credentials
user's credentials ( current implementation supports password only); it must be a non-null value
|
static java.lang.String |
DEFAULT_LDAP_HOST
The default host : localhost
|
static int |
DEFAULT_LDAP_PORT
Default ports for LDAP
|
static int |
DEFAULT_LDAPS_PORT
Default port for LDAPS
|
static java.lang.String |
DEFAULT_SSL_PROTOCOL
the default protocol used for creating SSL context
|
static long |
DEFAULT_TIMEOUT
The default timeout for operation : 30 seconds
|
private java.lang.String[] |
enabledCipherSuites
an array of cipher suites which are enabled, if set, will be used while initializing the SSL context
|
private java.lang.String[] |
enabledProtocols
an array of protocols which are enabled, if set, will be used while initializing the SSL context
|
private javax.net.ssl.KeyManager[] |
keyManagers
an array of key managers, if set, will be used while initializing the SSL context
|
static int |
LDAP_V3
The LDAP version
|
private LdapApiService |
ldapApiService
The Service to use internally when creating connections
|
private java.lang.String |
ldapHost
the remote LDAP host
|
private int |
ldapPort
The selected LDAP port
|
private static org.slf4j.Logger |
LOG
A logger for this class
|
private java.lang.String |
name
a valid Dn to authenticate the user
|
private java.security.SecureRandom |
secureRandom
an instance of SecureRandom, if set, will be used while initializing the SSL context
|
private java.lang.String |
sslProtocol
name of the protocol used for creating SSL context, default value is "TLS"
|
private long |
timeout
The session timeout
|
private javax.net.ssl.TrustManager[] |
trustManagers
an array of certificate trust managers, if set, will be used while initializing the SSL context
|
private boolean |
useSsl
A flag indicating if we are using SSL or not, default value is false
|
private boolean |
useTls
A flag indicating if we are using TLS or not, default value is false
|
| Constructor and Description |
|---|
LdapConnectionConfig()
Creates a default LdapConnectionConfig instance
|
| Modifier and Type | Method and Description |
|---|---|
BinaryAttributeDetector |
getBinaryAttributeDetector() |
java.lang.String |
getCredentials()
Gets the credentials.
|
java.lang.String |
getDefaultLdapHost()
Gets the default LDAP host.
|
int |
getDefaultLdapPort()
Gets the default LDAP port.
|
int |
getDefaultLdapsPort()
Gets the default LDAPS port.
|
long |
getDefaultTimeout()
Gets the default timeout.
|
java.lang.String[] |
getEnabledCipherSuites()
Gets the cipher suites which are enabled.
|
java.lang.String[] |
getEnabledProtocols()
Gets the protocols which are enabled.
|
javax.net.ssl.KeyManager[] |
getKeyManagers()
Gets the key managers.
|
LdapApiService |
getLdapApiService() |
java.lang.String |
getLdapHost()
Gets the LDAP host.
|
int |
getLdapPort()
Gets the LDAP port.
|
java.lang.String |
getName()
Gets the name that is used to authenticate the user.
|
java.security.SecureRandom |
getSecureRandom()
Gets the secure random.
|
java.lang.String |
getSslProtocol()
Gets the SSL protocol.
|
int |
getSupportedLdapVersion()
Gets the supported LDAP version.
|
long |
getTimeout()
Gets the timeout.
|
javax.net.ssl.TrustManager[] |
getTrustManagers()
Gets the trust managers.
|
boolean |
isUseSsl()
Checks if SSL (ldaps://) is used.
|
boolean |
isUseTls()
Checks if TLS is used.
|
void |
setBinaryAttributeDetector(BinaryAttributeDetector binaryAttributeDetector) |
void |
setCredentials(java.lang.String credentials)
Sets the credentials.
|
private void |
setDefaultTrustManager()
sets the default trust manager based on the SunX509 trustManagement algorithm
|
void |
setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)
Sets the cipher suites which are enabled
|
void |
setEnabledProtocols(java.lang.String... enabledProtocols)
Sets the protocols which are enabled
|
void |
setKeyManagers(javax.net.ssl.KeyManager[] keyManagers)
Sets the key managers.
|
void |
setLdapApiService(LdapApiService ldapApiService) |
void |
setLdapHost(java.lang.String ldapHost)
Sets the LDAP host.
|
void |
setLdapPort(int ldapPort)
Sets the LDAP port.
|
void |
setName(java.lang.String name)
Sets the name which is used to authenticate the user.
|
void |
setSecureRandom(java.security.SecureRandom secureRandom)
Sets the secure random.
|
void |
setSslProtocol(java.lang.String sslProtocol)
Sets the SSL protocol.
|
void |
setTimeout(long timeout)
Sets the timeout.
|
void |
setTrustManagers(javax.net.ssl.TrustManager... trustManagers)
Sets the trust managers.
|
void |
setUseSsl(boolean useSsl)
Sets whether SSL should be used.
|
void |
setUseTls(boolean useTls)
Sets whether TLS should be used.
|
private static final org.slf4j.Logger LOG
public static final int DEFAULT_LDAP_PORT
public static final int DEFAULT_LDAPS_PORT
public static final java.lang.String DEFAULT_LDAP_HOST
public static final int LDAP_V3
public static final long DEFAULT_TIMEOUT
public static final java.lang.String DEFAULT_SSL_PROTOCOL
private boolean useSsl
private long timeout
private boolean useTls
private int ldapPort
private java.lang.String ldapHost
private java.lang.String name
private java.lang.String credentials
private javax.net.ssl.KeyManager[] keyManagers
private java.security.SecureRandom secureRandom
private javax.net.ssl.TrustManager[] trustManagers
private java.lang.String[] enabledCipherSuites
private java.lang.String[] enabledProtocols
private java.lang.String sslProtocol
private BinaryAttributeDetector binaryAttributeDetector
private LdapApiService ldapApiService
public LdapConnectionConfig()
private void setDefaultTrustManager()
public boolean isUseSsl()
public void setUseSsl(boolean useSsl)
useSsl - true to use SSLpublic int getLdapPort()
public void setLdapPort(int ldapPort)
ldapPort - the new LDAP portpublic java.lang.String getLdapHost()
public void setLdapHost(java.lang.String ldapHost)
ldapHost - the new LDAP hostpublic java.lang.String getName()
public void setName(java.lang.String name)
name - the new namepublic java.lang.String getCredentials()
public void setCredentials(java.lang.String credentials)
credentials - the new credentialspublic int getDefaultLdapPort()
public int getDefaultLdapsPort()
public java.lang.String getDefaultLdapHost()
public long getDefaultTimeout()
public long getTimeout()
public void setTimeout(long timeout)
public int getSupportedLdapVersion()
public javax.net.ssl.TrustManager[] getTrustManagers()
public void setTrustManagers(javax.net.ssl.TrustManager... trustManagers)
trustManagers - the new trust managerspublic java.lang.String getSslProtocol()
public void setSslProtocol(java.lang.String sslProtocol)
sslProtocol - the new SSL protocolpublic javax.net.ssl.KeyManager[] getKeyManagers()
public void setKeyManagers(javax.net.ssl.KeyManager[] keyManagers)
keyManagers - the new key managerspublic java.security.SecureRandom getSecureRandom()
public void setSecureRandom(java.security.SecureRandom secureRandom)
secureRandom - the new secure randompublic java.lang.String[] getEnabledCipherSuites()
public void setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)
enabledCipherSuites - the cipher suites which are enabledpublic java.lang.String[] getEnabledProtocols()
public void setEnabledProtocols(java.lang.String... enabledProtocols)
enabledProtocols - the protocols which are enabledpublic BinaryAttributeDetector getBinaryAttributeDetector()
public void setBinaryAttributeDetector(BinaryAttributeDetector binaryAttributeDetector)
binaryAttributeDetector - the binaryAttributeDetector to setpublic boolean isUseTls()
public void setUseTls(boolean useTls)
useTls - true to use TLSpublic LdapApiService getLdapApiService()
public void setLdapApiService(LdapApiService ldapApiService)
ldapApiService - the ldapApiService to set