Package org.opends.server.types
Class LDAPURL
java.lang.Object
org.opends.server.types.LDAPURL
This class defines a data structure that represents the components of an LDAP URL, including the scheme, host, port,
base DN, attributes, scope, filter, and extensions. It has the ability to create an LDAP URL based on all of these
individual components, as well as parsing them from their string representations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FilterThe default search filter that will be used if none is provided. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the set of attributes for this LDAP URL.Retrieves the processed search filter for this LDAP URL.getHost()Retrieves the host for this LDAP URL.getName()Retrieves the processed DN for this LDAP URL.intgetPort()Retrieves the port for this LDAP URL.Retrieve the raw, unprocessed base DN for this LDAP URL.getScope()Retrieves the search scope for this LDAP URL.booleanisSecure()Returnstrueif this LDAP URL should use LDAPS orfalseif it should use LDAP.static LDAPURLpartiallyDecode(String url) Decodes the provided string as an LDAP URL, but do not decode the base DN and only keep it as a string instead (it can be retrieved by callinggetRawBaseDN()).toString()Retrieves a string representation of this LDAP URL.static LDAPURLDecodes the provided string as an LDAP URL.
-
Field Details
-
DEFAULT_SEARCH_FILTER
The default search filter that will be used if none is provided.
-
-
Method Details
-
valueOf
Decodes the provided string as an LDAP URL. This method also decodes the DN.- Parameters:
url- The URL string to be decoded.- Returns:
- The LDAP URL decoded from the provided string.
- Throws:
LdapException- If a problem occurs while attempting to decode the provided string as an LDAP URL.
-
partiallyDecode
Decodes the provided string as an LDAP URL, but do not decode the base DN and only keep it as a string instead (it can be retrieved by callinggetRawBaseDN()).- Parameters:
url- The URL string to be decoded.- Returns:
- The LDAP URL decoded from the provided string.
- Throws:
LdapException- If a problem occurs while attempting to decode the provided string as an LDAP URL.
-
isSecure
public boolean isSecure()Returnstrueif this LDAP URL should use LDAPS orfalseif it should use LDAP.- Returns:
trueif this LDAP URL should use LDAPS orfalseif it should use LDAP.
-
getHost
Retrieves the host for this LDAP URL.- Returns:
- The host for this LDAP URL, or
nullif none was provided.
-
getPort
public int getPort()Retrieves the port for this LDAP URL.- Returns:
- The port for this LDAP URL.
-
getRawBaseDN
Retrieve the raw, unprocessed base DN for this LDAP URL.- Returns:
- The raw, unprocessed base DN for this LDAP URL, or
nullif none was given (in which case a default of the null DN "" should be assumed).
-
getName
Retrieves the processed DN for this LDAP URL.- Returns:
- The processed DN for this LDAP URL.
- Throws:
LdapException- If the raw base DN cannot be decoded as a valid DN.
-
getAttributes
Retrieves the set of attributes for this LDAP URL. The contents of the returned set may be altered by the caller.- Returns:
- The set of attributes for this LDAP URL.
-
getScope
Retrieves the search scope for this LDAP URL.- Returns:
- The search scope for this LDAP URL, or
nullif none was given (in which case the base-level scope should be assumed).
-
getFilter
Retrieves the processed search filter for this LDAP URL.- Returns:
- The processed search filter for this LDAP URL.
-
toString
Retrieves a string representation of this LDAP URL.
-