java.lang.Object
com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPUrl
All Implemented Interfaces:
Serializable

This class provides a data structure that represents an LDAP URL.

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 LDAPURL class should be used instead.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    LDAPUrl(LDAPURL ldapURL)
    Creates a new LDAPUrl object from the provided LDAPURL object.
    Creates a new LDAPUrl object from the provided string representation.
    LDAPUrl(String host, int port, String dn)
    Creates a new LDAPUrl object with the provided information.
    LDAPUrl(String host, int port, String dn, String[] attributes, int scope, String filter)
    Creates a new LDAPUrl object with the provided information.
    LDAPUrl(String host, int port, String dn, Enumeration<String> attributes, int scope, String filter)
    Creates a new LDAPUrl object with the provided information.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether the provided object is equal to this LDAP URL.
    Retrieves an array of the names of the requested attributes for this LDAP URL, if available.
    Retrieves an enumeration of the names of the requested attributes for this LDAP URL, if available.
    Retrieves the DN for this LDAP URL, if available.
    Retrieves the filter for this LDAP URL.
    Retrieves the address for this LDAP URL, if available.
    int
    Retrieves the port number for this LDAP URL.
    int
    Retrieves the search scope for the LDAP URL.
    Retrieves a string representation of this LDAP URL.
    int
    Retrieves a hash code for this LDAP URL.
    final LDAPURL
    Retrieves an LDAPURL object that is the equivalent of this LDAP URL.
    Retrieves a string representation of this LDAP URL.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LDAPUrl

      Creates a new LDAPUrl object from the provided string representation.
      Parameters:
      url - The string representation of the LDAP URL to create.
      Throws:
      MalformedURLException - If the provided string cannot be parsed as a valid LDAP URL.
    • LDAPUrl

      public LDAPUrl(@Nullable String host, int port, @Nullable String dn) throws RuntimeException
      Creates a new LDAPUrl object with the provided information.
      Parameters:
      host - The address of the directory server, or null if there should not be an address.
      port - The port of the directory server.
      dn - The DN for the URL.
      Throws:
      RuntimeException - If any of the provided information cannot be used to create a valid LDAP URL.
    • LDAPUrl

      public LDAPUrl(@Nullable String host, int port, @Nullable String dn, @Nullable String[] attributes, int scope, @NotNull String filter) throws RuntimeException
      Creates a new LDAPUrl object with the provided information.
      Parameters:
      host - The address of the directory server, or null if there should not be an address.
      port - The port of the directory server.
      dn - The DN for the URL.
      attributes - The set of requested attributes.
      scope - The scope to use for the LDAP URL.
      filter - The filter to use for the LDAP URL.
      Throws:
      RuntimeException - If any of the provided information cannot be used to create a valid LDAP URL.
    • LDAPUrl

      public LDAPUrl(@Nullable String host, int port, @Nullable String dn, @Nullable Enumeration<String> attributes, int scope, @NotNull String filter) throws RuntimeException
      Creates a new LDAPUrl object with the provided information.
      Parameters:
      host - The address of the directory server, or null if there should not be an address.
      port - The port of the directory server.
      dn - The DN for the URL.
      attributes - The set of requested attributes.
      scope - The scope to use for the LDAP URL.
      filter - The filter to use for the LDAP URL.
      Throws:
      RuntimeException - If any of the provided information cannot be used to create a valid LDAP URL.
    • LDAPUrl

      public LDAPUrl(@NotNull LDAPURL ldapURL)
      Creates a new LDAPUrl object from the provided LDAPURL object.
      Parameters:
      ldapURL - The LDAPURL object to use to create this LDAP URL.
  • Method Details

    • getHost

      Retrieves the address for this LDAP URL, if available.
      Returns:
      The address for this LDAP URL, or null if it is not available.
    • getPort

      public int getPort()
      Retrieves the port number for this LDAP URL.
      Returns:
      The port number for this LDAP URL.
    • getDN

      Retrieves the DN for this LDAP URL, if available.
      Returns:
      The DN for this LDAP URL, or null if it is not available.
    • getAttributes

      Retrieves an enumeration of the names of the requested attributes for this LDAP URL, if available.
      Returns:
      An enumeration of the names of the requested attributes for this LDAP URL, or null if there are none.
    • getAttributeArray

      Retrieves an array of the names of the requested attributes for this LDAP URL, if available.
      Returns:
      An array of the names of the requested attributes for this LDAP URL, or null if there are none.
    • getScope

      public int getScope()
      Retrieves the search scope for the LDAP URL.
      Returns:
      The search scope for the LDAP URL.
    • getFilter

      Retrieves the filter for this LDAP URL.
      Returns:
      The filter for this LDAP URL.
    • hashCode

      public int hashCode()
      Retrieves a hash code for this LDAP URL.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code for this LDAP URL.
    • equals

      public boolean equals(@Nullable Object o)
      Indicates whether the provided object is equal to this LDAP URL.
      Overrides:
      equals in class Object
      Parameters:
      o - The object for which to make the determination.
      Returns:
      true if the provided object is equal to this LDAP URL, or false if not.
    • getUrl

      Retrieves a string representation of this LDAP URL.
      Returns:
      A string representation of this LDAP URL.
    • toLDAPURL

      @NotNull public final LDAPURL toLDAPURL()
      Retrieves an LDAPURL object that is the equivalent of this LDAP URL.
      Returns:
      An LDAPURL object that is the equivalent of this LDAP URL.
    • toString

      Retrieves a string representation of this LDAP URL.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this LDAP URL.