Class LDAPUrl

  • All Implemented Interfaces:
    java.io.Serializable

    @NotExtensible
    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public class LDAPUrl
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Indicates whether the provided object is equal to this LDAP URL.
      java.lang.String[] getAttributeArray()
      Retrieves an array of the names of the requested attributes for this LDAP URL, if available.
      java.util.Enumeration<java.lang.String> getAttributes()
      Retrieves an enumeration of the names of the requested attributes for this LDAP URL, if available.
      java.lang.String getDN()
      Retrieves the DN for this LDAP URL, if available.
      java.lang.String getFilter()
      Retrieves the filter for this LDAP URL.
      java.lang.String getHost()
      Retrieves the address for this LDAP URL, if available.
      int getPort()
      Retrieves the port number for this LDAP URL.
      int getScope()
      Retrieves the search scope for the LDAP URL.
      java.lang.String getUrl()
      Retrieves a string representation of this LDAP URL.
      int hashCode()
      Retrieves a hash code for this LDAP URL.
      LDAPURL toLDAPURL()
      Retrieves an LDAPURL object that is the equivalent of this LDAP URL.
      java.lang.String toString()
      Retrieves a string representation of this LDAP URL.
      • Methods inherited from class java.lang.Object

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

      • LDAPUrl

        public LDAPUrl​(java.lang.String url)
                throws java.net.MalformedURLException
        Creates a new LDAPUrl object from the provided string representation.
        Parameters:
        url - The string representation of the LDAP URL to create.
        Throws:
        java.net.MalformedURLException - If the provided string cannot be parsed as a valid LDAP URL.
      • LDAPUrl

        public LDAPUrl​(java.lang.String host,
                       int port,
                       java.lang.String dn)
                throws java.lang.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:
        java.lang.RuntimeException - If any of the provided information cannot be used to create a valid LDAP URL.
      • LDAPUrl

        public LDAPUrl​(java.lang.String host,
                       int port,
                       java.lang.String dn,
                       java.lang.String[] attributes,
                       int scope,
                       java.lang.String filter)
                throws java.lang.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:
        java.lang.RuntimeException - If any of the provided information cannot be used to create a valid LDAP URL.
      • LDAPUrl

        public LDAPUrl​(java.lang.String host,
                       int port,
                       java.lang.String dn,
                       java.util.Enumeration<java.lang.String> attributes,
                       int scope,
                       java.lang.String filter)
                throws java.lang.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:
        java.lang.RuntimeException - If any of the provided information cannot be used to create a valid LDAP URL.
      • LDAPUrl

        public LDAPUrl​(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 Detail

      • getHost

        public java.lang.String 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

        public java.lang.String 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

        public java.util.Enumeration<java.lang.String> 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

        public java.lang.String[] 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

        public java.lang.String 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 java.lang.Object
        Returns:
        A hash code for this LDAP URL.
      • equals

        public boolean equals​(java.lang.Object o)
        Indicates whether the provided object is equal to this LDAP URL.
        Overrides:
        equals in class java.lang.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

        public java.lang.String getUrl()
        Retrieves a string representation of this LDAP URL.
        Returns:
        A string representation of this LDAP URL.
      • toLDAPURL

        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

        public java.lang.String toString()
        Retrieves a string representation of this LDAP URL.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this LDAP URL.