Class LDAPDN


  • @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class LDAPDN
    extends java.lang.Object
    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 Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equals​(java.lang.String dn1, java.lang.String dn2)
      Indicates whether the provided strings represent the same distinguished name.
      static java.lang.String[] explodeDN​(java.lang.String dn, boolean noTypes)
      Explodes the provided DN into individual RDN components.
      static java.lang.String[] explodeRDN​(java.lang.String rdn, boolean noTypes)
      Explodes the provided RDN into individual name-value pairs.
      static java.lang.String normalize​(java.lang.String dn)
      Retrieves a normalized representation of the provided DN.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • normalize

        public static java.lang.String normalize​(java.lang.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

        public static java.lang.String[] explodeDN​(java.lang.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

        public static java.lang.String[] explodeRDN​(java.lang.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​(java.lang.String dn1,
                                     java.lang.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.