Class LDAPConnectionHandlerConfiguration

java.lang.Object
com.unboundid.ldap.sdk.unboundidds.LDAPConnectionHandlerConfiguration
All Implemented Interfaces:
Serializable, Comparable<LDAPConnectionHandlerConfiguration>, Comparator<LDAPConnectionHandlerConfiguration>

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 Details

    • getName

      Retrieves the name for the connection handler.
      Returns:
      The name for the connection handler.
    • isEnabled

      public boolean isEnabled()
      Indicates whether the connection handler is enabled for use.
      Returns:
      true if the connection handler is enabled, or false if 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

      public int getPort()
      Retrieves the port on which the connection handler accepts client connections.
      Returns:
      The port on which the connection handler accepts client connections.
    • usesSSL

      public boolean usesSSL()
      Indicates whether the connection handler uses SSL to encrypt communication.
      Returns:
      true if the connection handler uses SSL to encrypt communication, or false if not.
    • supportsStartTLS

      public boolean supportsStartTLS()
      Indicates whether the connection handler supports StartTLS for encrypting communication.
      Returns:
      true if the connection handler supports StartTLS for encrypting communication, or false if 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 the compareTo(com.unboundid.ldap.sdk.unboundidds.LDAPConnectionHandlerConfiguration) method documentation.
      Parameters:
      configFile - The configuration file to examine. It must not be null, 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

      public int hashCode()
      Retrieves a hash code for the connection handler configuration.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code for the connection handler configuration.
    • equals

      public boolean equals(@Nullable Object o)
      Indicates whether the provided object is considered logically equivalent to this LDAP connection handler configuration.
      Specified by:
      equals in interface Comparator<LDAPConnectionHandlerConfiguration>
      Overrides:
      equals in class Object
      Parameters:
      o - If the provided object is considered logically equivalent to this LDAP connection handler configuration, or false if 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:
      compareTo in interface Comparable<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

      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 the compareTo(com.unboundid.ldap.sdk.unboundidds.LDAPConnectionHandlerConfiguration) method.
      Specified by:
      compare in interface Comparator<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.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this LDAP connection handler configuration.
    • toString

      public void toString(@NotNull StringBuilder buffer)
      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.