public class LdapConnectionConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
private org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector |
binaryAttributeDetector
The class used to detect if an attribute is HR or not
|
private String |
credentials
user's credentials ( current implementation supports password only); it must be a non-null value
|
static 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 String |
DEFAULT_SSL_PROTOCOL
the default protocol used for creating SSL context
|
static long |
DEFAULT_TIMEOUT
The default timeout for operation : 30 seconds
|
private String[] |
enabledCipherSuites
an array of cipher suites which are enabled, if set, will be used while initializing the SSL context
|
private String[] |
enabledProtocols
an array of protocols which are enabled, if set, will be used while initializing the SSL context
|
private 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 org.apache.directory.api.ldap.codec.api.LdapApiService |
ldapApiService
The Service to use internally when creating connections
|
private 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 String |
name
a valid Dn to authenticate the user
|
private SecureRandom |
secureRandom
an instance of SecureRandom, if set, will be used while initializing the SSL context
|
private String |
sslProtocol
name of the protocol used for creating SSL context, default value is "TLS"
|
private long |
timeout
The session timeout
|
private 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 |
|---|---|
org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector |
getBinaryAttributeDetector() |
String |
getCredentials()
Gets the credentials.
|
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.
|
String[] |
getEnabledCipherSuites()
Gets the cipher suites which are enabled.
|
String[] |
getEnabledProtocols()
Gets the protocols which are enabled.
|
KeyManager[] |
getKeyManagers()
Gets the key managers.
|
org.apache.directory.api.ldap.codec.api.LdapApiService |
getLdapApiService() |
String |
getLdapHost()
Gets the LDAP host.
|
int |
getLdapPort()
Gets the LDAP port.
|
String |
getName()
Gets the name that is used to authenticate the user.
|
SecureRandom |
getSecureRandom()
Gets the secure random.
|
String |
getSslProtocol()
Gets the SSL protocol.
|
int |
getSupportedLdapVersion()
Gets the supported LDAP version.
|
long |
getTimeout()
Gets the timeout.
|
TrustManager[] |
getTrustManagers()
Gets the trust managers.
|
boolean |
isUseSsl()
Checks if SSL (ldaps://) is used.
|
boolean |
isUseTls()
Checks if TLS is used.
|
void |
setBinaryAttributeDetector(org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector binaryAttributeDetector) |
void |
setCredentials(String credentials)
Sets the credentials.
|
private void |
setDefaultTrustManager()
Sets the default trust manager based on the SunX509 trustManagement algorithm
We use a non-verification Trust Manager
|
void |
setEnabledCipherSuites(String[] enabledCipherSuites)
Sets the cipher suites which are enabled
|
void |
setEnabledProtocols(String... enabledProtocols)
Sets the protocols which are enabled
|
void |
setKeyManagers(KeyManager[] keyManagers)
Sets the key managers.
|
void |
setLdapApiService(org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService) |
void |
setLdapHost(String ldapHost)
Sets the LDAP host.
|
void |
setLdapPort(int ldapPort)
Sets the LDAP port.
|
void |
setName(String name)
Sets the name which is used to authenticate the user.
|
void |
setSecureRandom(SecureRandom secureRandom)
Sets the secure random.
|
void |
setSslProtocol(String sslProtocol)
Sets the SSL protocol.
|
void |
setTimeout(long timeout)
Sets the timeout.
|
void |
setTrustManagers(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 String DEFAULT_LDAP_HOST
public static final int LDAP_V3
public static final long DEFAULT_TIMEOUT
public static final String DEFAULT_SSL_PROTOCOL
private boolean useSsl
private long timeout
private boolean useTls
private int ldapPort
private String ldapHost
private String name
private String credentials
private KeyManager[] keyManagers
private SecureRandom secureRandom
private TrustManager[] trustManagers
private String[] enabledCipherSuites
private String[] enabledProtocols
private String sslProtocol
private org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector binaryAttributeDetector
private org.apache.directory.api.ldap.codec.api.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 String getLdapHost()
public void setLdapHost(String ldapHost)
ldapHost - the new LDAP hostpublic String getName()
public void setName(String name)
name - the new namepublic String getCredentials()
public void setCredentials(String credentials)
credentials - the new credentialspublic int getDefaultLdapPort()
public int getDefaultLdapsPort()
public String getDefaultLdapHost()
public long getDefaultTimeout()
public long getTimeout()
public void setTimeout(long timeout)
timeout - the timeout to setpublic int getSupportedLdapVersion()
public TrustManager[] getTrustManagers()
public void setTrustManagers(TrustManager... trustManagers)
trustManagers - the new trust managerspublic String getSslProtocol()
public void setSslProtocol(String sslProtocol)
sslProtocol - the new SSL protocolpublic KeyManager[] getKeyManagers()
public void setKeyManagers(KeyManager[] keyManagers)
keyManagers - the new key managerspublic SecureRandom getSecureRandom()
public void setSecureRandom(SecureRandom secureRandom)
secureRandom - the new secure randompublic String[] getEnabledCipherSuites()
public void setEnabledCipherSuites(String[] enabledCipherSuites)
enabledCipherSuites - the cipher suites which are enabledpublic String[] getEnabledProtocols()
public void setEnabledProtocols(String... enabledProtocols)
enabledProtocols - the protocols which are enabledpublic org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector getBinaryAttributeDetector()
public void setBinaryAttributeDetector(org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector binaryAttributeDetector)
binaryAttributeDetector - the binaryAttributeDetector to setpublic boolean isUseTls()
public void setUseTls(boolean useTls)
useTls - true to use TLSpublic org.apache.directory.api.ldap.codec.api.LdapApiService getLdapApiService()
public void setLdapApiService(org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService)
ldapApiService - the ldapApiService to setCopyright © 2009–2019 The Apache Software Foundation. All rights reserved.