Class LDAPUrl
java.lang.Object
com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPUrl
- All Implemented Interfaces:
Serializable
@NotExtensible
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public class LDAPUrl
extends Object
implements 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
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
ConstructorsConstructorDescriptionCreates a newLDAPUrlobject from the providedLDAPURLobject.Creates a newLDAPUrlobject from the provided string representation.Creates a newLDAPUrlobject with the provided information.Creates a newLDAPUrlobject with the provided information.Creates a newLDAPUrlobject with the provided information. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the provided object is equal to this LDAP URL.String[]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.getDN()Retrieves the DN for this LDAP URL, if available.Retrieves the filter for this LDAP URL.getHost()Retrieves the address for this LDAP URL, if available.intgetPort()Retrieves the port number for this LDAP URL.intgetScope()Retrieves the search scope for the LDAP URL.getUrl()Retrieves a string representation of this LDAP URL.inthashCode()Retrieves a hash code for this LDAP URL.final LDAPURLRetrieves anLDAPURLobject that is the equivalent of this LDAP URL.toString()Retrieves a string representation of this LDAP URL.
-
Constructor Details
-
LDAPUrl
Creates a newLDAPUrlobject 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
Creates a newLDAPUrlobject with the provided information.- Parameters:
host- The address of the directory server, ornullif 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 newLDAPUrlobject with the provided information.- Parameters:
host- The address of the directory server, ornullif 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 newLDAPUrlobject with the provided information.- Parameters:
host- The address of the directory server, ornullif 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
Creates a newLDAPUrlobject from the providedLDAPURLobject.- Parameters:
ldapURL- TheLDAPURLobject 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
nullif it is not available.
-
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
nullif 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
nullif 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
nullif there are none.
-
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
Retrieves a hash code for this LDAP URL. -
equals
Indicates whether the provided object is equal to this LDAP URL. -
getUrl
Retrieves a string representation of this LDAP URL.- Returns:
- A string representation of this LDAP URL.
-
toLDAPURL
Retrieves anLDAPURLobject that is the equivalent of this LDAP URL.- Returns:
- An
LDAPURLobject that is the equivalent of this LDAP URL.
-
toString
Retrieves a string representation of this LDAP URL.
-