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 Long |
closeTimeout
Timeout for close and unbind operations
|
private Long |
connectTimeout
Timeout for connect and bind operations
|
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 Long |
readOperationTimeout
Timeout for read operations (search, compare)
|
private SecureRandom |
secureRandom
an instance of SecureRandom, if set, will be used while initializing the SSL context
|
private Long |
sendTimeout
Timeout for I/O (TCP) writes
|
private String |
sslProtocol
name of the protocol used for creating SSL context, default value is "TLS"
|
private long |
timeout
The session timeout in milliseconds
|
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
|
private Long |
writeOperationTimeout
Timeout for write operations (add, modify, delete, ...)
|
| Constructor and Description |
|---|
LdapConnectionConfig()
Creates a default LdapConnectionConfig instance
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector |
getBinaryAttributeDetector() |
Long |
getCloseTimeout()
Gets close timeout in milliseconds.
|
Long |
getConnectTimeout()
Gets connect timeout in milliseconds.
|
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 in milliseconds.
|
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.
|
Long |
getReadOperationTimeout()
Gets read operation timeout in milliseconds.
|
SecureRandom |
getSecureRandom()
Gets the secure random.
|
Long |
getSendTimeout()
Gets send timeout in milliseconds.
|
String |
getSslProtocol()
Gets the SSL protocol.
|
int |
getSupportedLdapVersion()
Gets the supported LDAP version.
|
long |
getTimeout()
Gets the timeout in milliseconds.
|
TrustManager[] |
getTrustManagers()
Gets the trust managers.
|
Long |
getWriteOperationTimeout()
Gets write operation timeout in milliseconds.
|
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 |
setCloseTimeout(Long timeout)
Sets close timeout in milliseconds.
|
void |
setConnectTimeout(Long timeout)
Sets connect timeout in milliseconds.
|
void |
setCredentials(String credentials)
Sets the credentials.
|
private void |
setDefaultTrustManager()
Sets the default trust manager based on the SunX509 trustManagement algorithm
|
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 |
setReadOperationTimeout(Long timeout)
Sets read operation timeout in milliseconds.
|
void |
setSecureRandom(SecureRandom secureRandom)
Sets the secure random.
|
void |
setSendTimeout(Long timeout)
Sets the send timeout in milliseconds.
|
void |
setSslProtocol(String sslProtocol)
Sets the SSL protocol.
|
void |
setTimeout(long timeout)
Sets the timeout in milliseconds.
|
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.
|
void |
setWriteOperationTimeout(Long timeout)
Sets write operation timeout in milliseconds.
|
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 Long connectTimeout
private Long writeOperationTimeout
private Long readOperationTimeout
private Long closeTimeout
private Long sendTimeout
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 in milliseconds to set. If < 0, will be set to infinitepublic Long getConnectTimeout()
public void setConnectTimeout(Long timeout)
timeout - the timeout in milliseconds to set. If < 0, will be set to infinitepublic Long getWriteOperationTimeout()
public void setWriteOperationTimeout(Long timeout)
timeout - the timeout in milliseconds to set. If < 0, will be set to infinitepublic Long getReadOperationTimeout()
public void setReadOperationTimeout(Long timeout)
timeout - the timeout in milliseconds to set. If < 0, will be set to infinitepublic Long getCloseTimeout()
public void setCloseTimeout(Long timeout)
timeout - the timeout in milliseconds to set. If < 0, will be set to infinitepublic Long getSendTimeout()
public void setSendTimeout(Long timeout)
timeout - the timeout in milliseconds to set. If < 0, will be set to infinitepublic int getSupportedLdapVersion()
public TrustManager[] getTrustManagers()
public void setTrustManagers(TrustManager... trustManagers)
trustManagers - the new trust managersIllegalArgumentException - if the trustManagers parameter is null or emptypublic 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–2023 The Apache Software Foundation. All rights reserved.