java.lang.Object
com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPDN

This class provides a set of utility methods for working with LDAP DNs.

This class is primarily intended to be used in the process of updating applications which use the Netscape Directory SDK for Java to switch to or coexist with the UnboundID LDAP SDK for Java. For applications not written using the Netscape Directory SDK for Java, the DN class should be used instead.
  • Method Details

    • normalize

      @NotNull public static String normalize(@NotNull String dn)
      Retrieves a normalized representation of the provided DN. If the provided string does not represent a valid distinguished name, then the value returned by this method will not be reliable.
      Parameters:
      dn - The string representation of the DN to be normalized.
      Returns:
      A normalized representation of the provided DN.
    • explodeDN

      @NotNull public static String[] explodeDN(@NotNull String dn, boolean noTypes)
      Explodes the provided DN into individual RDN components. If the provided string does not represent a valid distinguished name, then the value returned by this method will not be reliable.
      Parameters:
      dn - The DN to be exploded into its RDN components.
      noTypes - Indicates whether to exclude the attribute names and equal signs and only include the values of the RDN components.
      Returns:
      An exploded representation of the provided DN.
    • explodeRDN

      @NotNull public static String[] explodeRDN(@NotNull String rdn, boolean noTypes)
      Explodes the provided RDN into individual name-value pairs. If the provided string does not represent a valid relative distinguished name, then the value returned by this method will not be reliable.
      Parameters:
      rdn - The RDN to be exploded into its name-value pairs.
      noTypes - Indicates whether to exclude the attribute names and equal signs and only include the values of the components.
      Returns:
      An exploded representation of the provided DN.
    • equals

      public static boolean equals(@NotNull String dn1, @NotNull String dn2)
      Indicates whether the provided strings represent the same distinguished name.
      Parameters:
      dn1 - The first DN to be compared.
      dn2 - The second DN to be compared.
      Returns:
      true if the provided strings represent the same distinguished name, or false if not or if either of the values cannot be parsed as a valid DN.