Class LDAPConnectionHandlerConfiguration
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.LDAPConnectionHandlerConfiguration
- All Implemented Interfaces:
Serializable,Comparable<LDAPConnectionHandlerConfiguration>,Comparator<LDAPConnectionHandlerConfiguration>
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class LDAPConnectionHandlerConfiguration
extends Object
implements Comparable<LDAPConnectionHandlerConfiguration>, Comparator<LDAPConnectionHandlerConfiguration>, Serializable
This class provides a data structure that holds information about an LDAP
connection handler defined in the configuration of a Ping Identity Directory
Server instance. It also provides a utility method for reading a Directory
Server configuration file to obtain information about the listener instances
it contains, and it implements the
Comparable interface for ranking
connection handlers by relative preference for use.
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintCompares the provided configurations to determine their relative orders in which they should appear in a supported list.intCompares the provided configuration to this configuration to determine the relative orders in which they should appear in a supported list.booleanIndicates whether the provided object is considered logically equivalent to this LDAP connection handler configuration.Retrieves the set of addresses on which the connection handler accepts client connections, if available.getName()Retrieves the name for the connection handler.intgetPort()Retrieves the port on which the connection handler accepts client connections.inthashCode()Retrieves a hash code for the connection handler configuration.booleanIndicates whether the connection handler is enabled for use.readConfiguration(File configFile, boolean onlyEnabled) Retrieves the LDAP connection handler configuration objects from the specified configuration file.booleanIndicates whether the connection handler supports StartTLS for encrypting communication.toString()Retrieves a string representation of this LDAP connection handler configuration.voidtoString(StringBuilder buffer) Appends a string representation of this LDAP connection handler configuration to the provided buffer.booleanusesSSL()Indicates whether the connection handler uses SSL to encrypt communication.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
getName
Retrieves the name for the connection handler.- Returns:
- The name for the connection handler.
-
isEnabled
Indicates whether the connection handler is enabled for use.- Returns:
trueif the connection handler is enabled, orfalseif not.
-
getListenAddresses
Retrieves the set of addresses on which the connection handler accepts client connections, if available.- Returns:
- The set of addresses on which the connection handler accepts client connections, or an empty set if the connection handler listens on all addresses on all interfaces.
-
getPort
Retrieves the port on which the connection handler accepts client connections.- Returns:
- The port on which the connection handler accepts client connections.
-
usesSSL
Indicates whether the connection handler uses SSL to encrypt communication.- Returns:
trueif the connection handler uses SSL to encrypt communication, orfalseif not.
-
supportsStartTLS
Indicates whether the connection handler supports StartTLS for encrypting communication.- Returns:
trueif the connection handler supports StartTLS for encrypting communication, orfalseif not.
-
readConfiguration
@NotNull public static List<LDAPConnectionHandlerConfiguration> readConfiguration(@NotNull File configFile, boolean onlyEnabled) throws LDAPException Retrieves the LDAP connection handler configuration objects from the specified configuration file. The configuration objects will be ordered from most preferred to least preferred, using the logic described in thecompareTo(com.unboundid.ldap.sdk.unboundidds.LDAPConnectionHandlerConfiguration)method documentation.- Parameters:
configFile- The configuration file to examine. It must not benull, and it must exist.onlyEnabled- Indicates whether to only include information about connection handlers that are enabled.- Returns:
- A list of the LDAP connection handler configuration objects read from the specified configuration file, or an empty set if no LDAP connection handler configuration entries were found in the configuration.
- Throws:
LDAPException- If a problem interferes with reading the connection handler configuration objects from the configuration file.
-
hashCode
Retrieves a hash code for the connection handler configuration. -
equals
Indicates whether the provided object is considered logically equivalent to this LDAP connection handler configuration.- Specified by:
equalsin interfaceComparator<LDAPConnectionHandlerConfiguration>- Overrides:
equalsin classObject- Parameters:
o- If the provided object is considered logically equivalent to this LDAP connection handler configuration, orfalseif not.
-
compareTo
Compares the provided configuration to this configuration to determine the relative orders in which they should appear in a supported list. Sorting will use the following criteria:- Connection handlers that are enabled will be ordered before those that are disabled.
- Connection handlers that use SSL will be ordered before those that support StartTLS, and those that support StartTLS will be ordered before those that do not support StartTLS.
- An SSL-enabled connection handler named "LDAPS Connection Handler" will be ordered before an SSL-enabled connection handler with some other name. A non-SSL-enabled connection handler named "LDAP Connection Handler" will be ordered before a non-SSL-enabled connection handler with some other name.
- Connection handlers that do not use listen addresses (and therefore listen on all interfaces) will be ordered before those that are configured with one or more listen addresses.
- Connection handlers with a lower port number will be ordered before those with a higher port number.
- As a last resort, then connection handlers will be ordered lexicographically by name.
- Specified by:
compareToin interfaceComparable<LDAPConnectionHandlerConfiguration>- Parameters:
config- The LDAP connection handler configuration to compare against this configuration.- Returns:
- A negative value if this configuration should be ordered before the provided configuration, a positive value if the provided configuration should be ordered before this configuration, or zero if the configurations are considered logically equivalent.
-
compare
public int compare(@NotNull LDAPConnectionHandlerConfiguration c1, @NotNull LDAPConnectionHandlerConfiguration c2) Compares the provided configurations to determine their relative orders in which they should appear in a supported list. Sorting will use the criteria described in the documentation for thecompareTo(com.unboundid.ldap.sdk.unboundidds.LDAPConnectionHandlerConfiguration)method.- Specified by:
comparein interfaceComparator<LDAPConnectionHandlerConfiguration>- Parameters:
c1- The first LDAP connection handler configuration to compare.c2- The second LDAP connection handler configuration to compare.- Returns:
- A negative value if the first configuration should be ordered before the second configuration, a positive value if the first configuration should be ordered after the second configuration, or zero if the configurations are considered logically equivalent.
-
toString
Retrieves a string representation of this LDAP connection handler configuration. -
toString
Appends a string representation of this LDAP connection handler configuration to the provided buffer.- Parameters:
buffer- The buffer to which the information should be appended.
-