LdapName implements compound names for LDAP v3 as
specified by RFC 2253.
RFC 2253 has a few ambiguities and outright inconsistencies. These are resolved as follows:
String names passed to LdapName or returned by it
use the full 16-bit Unicode character set. They may also contain
characters encoded into UTF-8 with each octet represented by a
three-character substring such as "\\B4".
They may not, however, contain characters encoded into UTF-8 with
each octet represented by a single character in the string: the
meaning would be ambiguous.
LdapName will properly parse all valid names, but
does not attempt to detect all possible violations when parsing
invalid names. It's "generous".
When names are tested for equality, attribute types and binary values are case-insensitive, and string values are by default case-insensitive. String values with different but equivalent usage of quoting, escaping, or UTF8-hex-encoding are considered equal. The order of components in multi-valued RDNs (such as "ou=Sales+cn=Bob") is not significant.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private transient Vector | |
| pack-priv static final long | |
| private transient String | |
| private transient boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Name | |
| public Name | add(int pos, String comp)
Implements javax. Adds a single component at a specified position within this name. |
| public Name | addAll(Name suffix)
Implements javax. Adds the components of a name -- in order -- to the end of this name. |
| public Name | addAll(int pos, Name suffix)
Implements javax. Adds the components of a name -- in order -- at a specified position within this name. |
| public Object | clone()
Overrides java. Implements javax. Generates a new copy of this name. |
| public int | compareTo(Object obj)
Implements javax. Compares this name with another name for order. |
| public boolean | endsWith(Name n)
Implements javax. Determines whether this name ends with a specified suffix. |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public static String | escapeAttributeValue(Object val)
Given the value of an attribute, returns a string suitable for inclusion in a DN. |
| public String | |
| public Enumeration | getAll()
Implements javax. Retrieves the components of this name as an enumeration of strings. |
| public Name | getPrefix(int pos)
Implements javax. Creates a name whose components consist of a prefix of the components of this name. |
| public Name | getSuffix(int pos)
Implements javax. Creates a name whose components consist of a suffix of the components in this name. |
| public int | |
| public boolean | |
| private static boolean | |
| private boolean | |
| private void | |
| private void | |
| public Object | |
| public void | setValuesCaseSensitive(boolean caseSensitive)
Controls whether string-values are treated as case-sensitive when the string values within names are compared. |
| public int | |
| public boolean | startsWith(Name n)
Implements javax. Determines whether this name starts with a specified prefix. |
| public String | |
| public static Object | unescapeAttributeValue(String val)
Given an attribute value formatted according to RFC 2253, returns the unformatted value. |
| private void | writeObject(ObjectOutputStream s)
Serializes only the unparsed DN, for compactness and to avoid any implementation dependency. |
| rdns | back to summary |
|---|---|
| private transient Vector<LdapName. | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| unparsed | back to summary |
|---|---|
| private transient String unparsed | |
| valuesCaseSensitive | back to summary |
|---|---|
| private transient boolean valuesCaseSensitive | |
| LdapName | back to summary |
|---|---|
| public LdapName(String name) throws InvalidNameException Constructs an LDAP name from the given DN.
| |
| LdapName | back to summary |
|---|---|
private LdapName(String name, Vector<LdapName.
| |
| LdapName | back to summary |
|---|---|
| private LdapName(String name, Vector<LdapName. | |
| add | back to summary |
|---|---|
| public Name add(String comp) throws InvalidNameException Implements javax. Doc from javax. Adds a single component to the end of this name.
| |
| add | back to summary |
|---|---|
| public Name add(int pos, String comp) throws InvalidNameException Implements javax. Doc from javax. Adds a single component at a specified position within this name. Components of this name at or after the index of the new component are shifted up by one (away from index 0) to accommodate the new component.
| |
| addAll | back to summary |
|---|---|
| public Name addAll(Name suffix) throws InvalidNameException Implements javax. Doc from javax. Adds the components of a name -- in order -- to the end of this name.
| |
| addAll | back to summary |
|---|---|
| public Name addAll(int pos, Name suffix) throws InvalidNameException Implements javax. Doc from javax. Adds the components of a name -- in order -- at a specified position within this name. Components of this name at or after the index of the first new component are shifted up (away from 0) to accommodate the new components.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Implements javax. Doc from javax. Generates a new copy of this name. Subsequent changes to the components of this name will not affect the new copy, and vice versa. | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object obj) Implements javax. Doc from javax. Compares this name with another name for order. Returns a negative integer, zero, or a positive integer as this name is less than, equal to, or greater than the given name. As with | |
| endsWith | back to summary |
|---|---|
| public boolean endsWith(Name n) Implements javax. Doc from javax. Determines whether this name ends with a specified suffix.
A name | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| escapeAttributeValue | back to summary |
|---|---|
| public static String escapeAttributeValue(Object val) Given the value of an attribute, returns a string suitable for inclusion in a DN. If the value is a string, this is accomplished by using backslash (\) to escape the following characters:
| |
| get | back to summary |
|---|---|
| public String get(int pos) Implements javax. Doc from javax. Retrieves a component of this name. | |
| getAll | back to summary |
|---|---|
| public Enumeration Implements javax. Doc from javax. Retrieves the components of this name as an enumeration of strings. The effect on the enumeration of updates to this name is undefined. If the name has zero components, an empty (non-null) enumeration is returned. | |
| getPrefix | back to summary |
|---|---|
| public Name getPrefix(int pos) Implements javax. Doc from javax. Creates a name whose components consist of a prefix of the components of this name. Subsequent changes to this name will not affect the name that is returned and vice versa. | |
| getSuffix | back to summary |
|---|---|
| public Name getSuffix(int pos) Implements javax. Doc from javax. Creates a name whose components consist of a suffix of the components in this name. Subsequent changes to this name do not affect the name that is returned and vice versa. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements javax. Doc from javax. Determines whether this name is empty. An empty name is one with zero components. | |
| isWhitespace | back to summary |
|---|---|
| private static boolean isWhitespace(char c) | |
| matches | back to summary |
|---|---|
| private boolean matches(int beg, int end, Name n) | |
| parse | back to summary |
|---|---|
| private void parse() throws InvalidNameException | |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException | |
| remove | back to summary |
|---|---|
| public Object remove(int pos) throws InvalidNameException Implements javax. Doc from javax. Removes a component from this name. The component of this name at the specified position is removed. Components with indexes greater than this position are shifted down (toward index 0) by one.
| |
| setValuesCaseSensitive | back to summary |
|---|---|
| public void setValuesCaseSensitive(boolean caseSensitive) Controls whether string-values are treated as case-sensitive when the string values within names are compared. The default behavior is case-insensitive comparison. | |
| size | back to summary |
|---|---|
| public int size() Implements javax. Doc from javax. Returns the number of components in this name. | |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(Name n) Implements javax. Doc from javax. Determines whether this name starts with a specified prefix.
A name | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| unescapeAttributeValue | back to summary |
|---|---|
| public static Object unescapeAttributeValue(String val) Given an attribute value formatted according to RFC 2253, returns the unformatted value. Returns a string value as a string, and a binary value as a byte array. | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Serializes only the unparsed DN, for compactness and to avoid any implementation dependency.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final char[] | |
| private int | |
| private final int | |
| private final String | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| private void | |
| pack-priv Vector | |
| pack-priv LdapName. | |
| private String | |
| private String | |
| private String | |
| private String | |
| private LdapName. | |
| private String |
| chars | back to summary |
|---|---|
| private final char[] chars | |
| cur | back to summary |
|---|---|
| private int cur | |
| len | back to summary |
|---|---|
| private final int len | |
| name | back to summary |
|---|---|
| private final String name | |
| valuesCaseSensitive | back to summary |
|---|---|
| private boolean valuesCaseSensitive | |
| DnParser | back to summary |
|---|---|
| pack-priv DnParser(String name, boolean valuesCaseSensitive) throws InvalidNameException | |
| atTerminator | back to summary |
|---|---|
| private boolean atTerminator() | |
| consumeWhitespace | back to summary |
|---|---|
| private void consumeWhitespace() | |
| getDn | back to summary |
|---|---|
| pack-priv Vector | |
| getRdn | back to summary |
|---|---|
| pack-priv LdapName. | |
| parseAttrType | back to summary |
|---|---|
| private String parseAttrType() throws InvalidNameException | |
| parseAttrValue | back to summary |
|---|---|
| private String parseAttrValue() throws InvalidNameException | |
| parseBinaryAttrValue | back to summary |
|---|---|
| private String parseBinaryAttrValue() throws InvalidNameException | |
| parseQuotedAttrValue | back to summary |
|---|---|
| private String parseQuotedAttrValue() throws InvalidNameException | |
| parseRdn | back to summary |
|---|---|
| private LdapName. | |
| parseStringAttrValue | back to summary |
|---|---|
| private String parseStringAttrValue() throws InvalidNameException | |
| Modifier and Type | Field and Description |
|---|---|
| private final Vector |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public int | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| pack-priv Attributes | |
| public String |
| tvs | back to summary |
|---|---|
| private final Vector<LdapName. | |
| Rdn | back to summary |
|---|---|
| pack-priv Rdn() | |
| add | back to summary |
|---|---|
| pack-priv void add(LdapName. | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object obj) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toAttributes | back to summary |
|---|---|
| pack-priv Attributes toAttributes() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private String | |
| private final String | |
| private final String | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| private static byte[] | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| private static String | |
| private static String | |
| pack-priv static String | |
| pack-priv String | |
| pack-priv Object | |
| private static byte[] | |
| private String | |
| public int | |
| public String | |
| pack-priv static Object |
| binary | back to summary |
|---|---|
| private final boolean binary | |
| comparable | back to summary |
|---|---|
| private String comparable | |
| type | back to summary |
|---|---|
| private final String type | |
| value | back to summary |
|---|---|
| private final String value | |
| valueCaseSensitive | back to summary |
|---|---|
| private final boolean valueCaseSensitive | |
| TypeAndValue | back to summary |
|---|---|
| pack-priv TypeAndValue(String type, String value, boolean valueCaseSensitive) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object obj) | |
| decodeHexPairs | back to summary |
|---|---|
| private static byte[] decodeHexPairs(char[] chars, int beg, int end) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| escapeBinaryValue | back to summary |
|---|---|
| private static String escapeBinaryValue(byte[] val) | |
| escapeStringValue | back to summary |
|---|---|
| private static String escapeStringValue(String val) | |
| escapeValue | back to summary |
|---|---|
| pack-priv static String escapeValue(Object val) | |
| getType | back to summary |
|---|---|
| pack-priv String getType() | |
| getUnescapedValue | back to summary |
|---|---|
| pack-priv Object getUnescapedValue() | |
| getUtf8Octets | back to summary |
|---|---|
| private static byte[] getUtf8Octets(char[] chars, int beg, int end) | |
| getValueComparable | back to summary |
|---|---|
| private String getValueComparable() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| unescapeValue | back to summary |
|---|---|
| pack-priv static Object unescapeValue(String val) | |