Package com.nimbusds.common.config
Class LDAPServerDetails
- java.lang.Object
-
- com.nimbusds.common.config.LDAPServerDetails
-
- All Implemented Interfaces:
LoggableConfiguration
- Direct Known Subclasses:
LDAPServerConnectionPoolDetails
public class LDAPServerDetails extends Object implements LoggableConfiguration
LDAP server connect details.The configuration is stored as public fields which become immutable (final) after their initialisation.
Property keys: [prefix]*
-
-
Field Summary
Fields Modifier and Type Field Description int
connectTimeout
The timeout in milliseconds for LDAP connect requests.static int
DEFAULT_CONNECT_TIMEOUT
The default timeout in milliseconds for LDAP connect requests.static int
DEFAULT_RESPONSE_TIMEOUT
The default timeout in milliseconds for LDAP server responses.static LDAPConnectionSecurity
DEFAULT_SECURITY
The default LDAP connection security.static ServerSelectionAlgorithm
DEFAULT_SELECTION_ALGORITHM
The default server selection algorithm.static boolean
DEFAULT_SELF_SIGNED_CERTS_TRUST
The default trust for self-signed certificates.int
responseTimeout
The timeout in milliseconds for LDAP server responses.LDAPConnectionSecurity
security
The LDAP connection security.ServerSelectionAlgorithm
selectionAlgorithm
The preferred algorithm for selecting an LDAP server from the array specified byurl
,null
if only a single server URL is defined.boolean
trustSelfSignedCerts
Determines whether to accept self-signed certificates presented by the LDAP server (for secure SSL or StartTLS connections).com.unboundid.ldap.sdk.LDAPURL[]
url
Specifies an array of one or more LDAP server URLs.-
Fields inherited from interface com.nimbusds.common.config.LoggableConfiguration
LOG_CATEGORY
-
-
Constructor Summary
Constructors Constructor Description LDAPServerDetails(com.unboundid.ldap.sdk.LDAPURL[] url, ServerSelectionAlgorithm selectionAlgorithm, LDAPConnectionSecurity security, int connectTimeout, int responseTimeout, boolean trustSelfSignedCerts)
Creates a new LDAP server details instance.LDAPServerDetails(com.unboundid.ldap.sdk.LDAPURL url, LDAPConnectionSecurity security, int connectTimeout, int responseTimeout, boolean trustSelfSignedCerts)
Creates a new LDAP server details instance.LDAPServerDetails(String prefix, Properties props)
Creates a new LDAP server details instance from the specified properties.LDAPServerDetails(String prefix, Properties props, boolean requireURL)
Creates a new LDAP server details instance from the specified properties.
-
-
-
Field Detail
-
url
public final com.unboundid.ldap.sdk.LDAPURL[] url
Specifies an array of one or more LDAP server URLs. If notnull
the array is guaranteed to contain at least one LDAP URL.Property key: [prefix]url
-
selectionAlgorithm
public final ServerSelectionAlgorithm selectionAlgorithm
The preferred algorithm for selecting an LDAP server from the array specified byurl
,null
if only a single server URL is defined.Property key: [prefix]selectionAlgorithm
-
DEFAULT_SELECTION_ALGORITHM
public static final ServerSelectionAlgorithm DEFAULT_SELECTION_ALGORITHM
The default server selection algorithm.
-
security
public final LDAPConnectionSecurity security
The LDAP connection security.Property key: [prefix]security
-
DEFAULT_SECURITY
public static final LDAPConnectionSecurity DEFAULT_SECURITY
The default LDAP connection security.
-
connectTimeout
public final int connectTimeout
The timeout in milliseconds for LDAP connect requests. If zero the underlying LDAP client library will determine this value.Property key: [prefix]connectTimeout
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
The default timeout in milliseconds for LDAP connect requests.- See Also:
- Constant Field Values
-
responseTimeout
public final int responseTimeout
The timeout in milliseconds for LDAP server responses. If zero the underlying LDAP client library will determine this value.Property key: [prefix]responseTimeout
-
DEFAULT_RESPONSE_TIMEOUT
public static final int DEFAULT_RESPONSE_TIMEOUT
The default timeout in milliseconds for LDAP server responses.- See Also:
- Constant Field Values
-
trustSelfSignedCerts
public final boolean trustSelfSignedCerts
Determines whether to accept self-signed certificates presented by the LDAP server (for secure SSL or StartTLS connections).Property key: [prefix]trustSelfSignedCerts
-
DEFAULT_SELF_SIGNED_CERTS_TRUST
public static final boolean DEFAULT_SELF_SIGNED_CERTS_TRUST
The default trust for self-signed certificates.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LDAPServerDetails
public LDAPServerDetails(com.unboundid.ldap.sdk.LDAPURL url, LDAPConnectionSecurity security, int connectTimeout, int responseTimeout, boolean trustSelfSignedCerts)
Creates a new LDAP server details instance.- Parameters:
url
- The LDAP server URL. Must not benull
.security
- The LDAP connection security. Must not benull
.connectTimeout
- The LDAP server connect timeout, in milliseconds. If zero the underlying LDAP client library will determine this value.responseTimeout
- The LDAP server response timeout, in milliseconds. If zero the underlying LDAP client library will determine this value.trustSelfSignedCerts
- Determines whether to accept self-signed certificates presented by the LDAP server (for secure SSL or StartTLS connections).
-
LDAPServerDetails
public LDAPServerDetails(com.unboundid.ldap.sdk.LDAPURL[] url, ServerSelectionAlgorithm selectionAlgorithm, LDAPConnectionSecurity security, int connectTimeout, int responseTimeout, boolean trustSelfSignedCerts)
Creates a new LDAP server details instance.- Parameters:
url
- An array of one or more LDAP server URLs. It must contain at least one LDAP URL and not benull
.selectionAlgorithm
- The preferred algorithm for selecting an LDAP server from the URL array. May benull
if only a single LDAP server URL is defined.security
- The LDAP connection security. Must not benull
.connectTimeout
- The LDAP server connect timeout, in milliseconds. If zero the underlying LDAP client library will determine this value.responseTimeout
- The LDAP server response timeout, in milliseconds. If zero the underlying LDAP client library will determine this value.trustSelfSignedCerts
- Determines whether to accept self-signed certificates presented by the LDAP server (for secure SSL or StartTLS connections).
-
LDAPServerDetails
public LDAPServerDetails(String prefix, Properties props) throws com.thetransactioncompany.util.PropertyParseException
Creates a new LDAP server details instance from the specified properties.Mandatory properties:
- [prefix]url
Conditionally mandatory properties:
- [prefix]selectionAlgorithm - if more than one LDAP server URL is specified.
Optional properties, with defaults:
- [prefix]security = STARTTLS
- [prefix]connectTimeout = 0
- [prefix]responseTimeout = 0
- [prefix]trustSelfSignedCerts = false
- Parameters:
prefix
- The properties prefix. Must not benull
.props
- The properties. Must not benull
.- Throws:
com.thetransactioncompany.util.PropertyParseException
- On a missing or invalid property.
-
LDAPServerDetails
public LDAPServerDetails(String prefix, Properties props, boolean requireURL) throws com.thetransactioncompany.util.PropertyParseException
Creates a new LDAP server details instance from the specified properties.Mandatory properties:
- none
Conditionally mandatory properties:
- [prefix]url
- [prefix]selectionAlgorithm - if more than one LDAP server URL is specified.
Optional properties, with defaults:
- [prefix]security = STARTTLS
- [prefix]connectTimeout = 0
- [prefix]responseTimeout = 0
- [prefix]trustSelfSignedCerts = false
- Parameters:
prefix
- The properties prefix. Must not benull
.props
- The properties. Must not benull
.- Throws:
com.thetransactioncompany.util.PropertyParseException
- On a missing or invalid property.
-
-
Method Detail
-
log
public void log()
Logs the configuration details at INFO level.- Specified by:
log
in interfaceLoggableConfiguration
-
-