Package org.ldaptive
Class DnParser
java.lang.Object
org.ldaptive.DnParser
Deprecated.
Parses DNs following the rules in RFC 4514. Attempts to be as
generous as possible in the format of allowed DNs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Deprecated.Parse handler for decoding octet strings. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<LdapAttribute> Deprecated.Parses the supplied DN and converts each RDN into aLdapAttribute
.protected static byte[]
decodeHexValue
(char[] value) Deprecated.Decodes the supplied hexadecimal value.protected static String
decodeStringValue
(String value) Deprecated.Decodes the supplied string attribute value.static String
Deprecated.Returns the RDN value for the attribute type with the supplied name.static Collection
<String> Deprecated.Returns the RDN values for the attribute type with the supplied name.private static int
readToChar
(String s, char[] chars, int pos) Deprecated.Reads the supplied string starting at the supplied position until one of the supplied characters is found.static String
Deprecated.Returns a string representation of the supplied DN beginning at the supplied index.static String
Deprecated.Returns a string representation of the supplied DN beginning at beginIndex (inclusive) and ending at endIndex (exclusive).
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGERDeprecated.Logger for this class. -
HEX_RADIX
private static final int HEX_RADIXDeprecated.Hexadecimal radix.- See Also:
-
HEX_PATH
Deprecated.DER path for hex values.
-
-
Constructor Details
-
DnParser
private DnParser()Deprecated.Default constructor.
-
-
Method Details
-
getValues
Deprecated.Returns the RDN values for the attribute type with the supplied name.- Parameters:
dn
- to parsename
- of the attribute type to return values for- Returns:
- DN attribute values
-
getValue
Deprecated.Returns the RDN value for the attribute type with the supplied name. If the component has multiple values, the first one is returned.- Parameters:
dn
- to parsename
- of the attribute to return value for- Returns:
- DN attribute value
-
substring
Deprecated.Returns a string representation of the supplied DN beginning at the supplied index. The leftmost RDN component begins at index 0.- Parameters:
dn
- to parsebeginIndex
- index of first RDN to include in the result in the range [0, N-1] where N is the number of elements in the DN- Returns:
- DN from the supplied beginIndex
- Throws:
IndexOutOfBoundsException
- if beginIndex is less than 0 or greater than the number of RDNs
-
substring
Deprecated.Returns a string representation of the supplied DN beginning at beginIndex (inclusive) and ending at endIndex (exclusive). The leftmost RDN component begins at index 0. Where n is the number of RDNs, both beginIndex and endIndex are on the range [0, N-1].- Parameters:
dn
- to parsebeginIndex
- index of first RDN to include in the result in the range [0, N-2] where N is the number of elements in the DNendIndex
- index of last RDN to include in the result in the range [1, N-1] where N is the number of elements in the RDN- Returns:
- DN from beginIndex (inclusive) to endIndex (exclusive)
- Throws:
IndexOutOfBoundsException
- if beginIndex is less than 0, if beginIndex is greater than endIndex, or endIndex is greater than the number of RDNs
-
convertDnToAttributes
Deprecated.Parses the supplied DN and converts each RDN into aLdapAttribute
.- Parameters:
dn
- to parse- Returns:
- list of ldap attributes for each RDN
-
decodeHexValue
protected static byte[] decodeHexValue(char[] value) Deprecated.Decodes the supplied hexadecimal value.- Parameters:
value
- hex to decode- Returns:
- decoded bytes
-
decodeStringValue
Deprecated.Decodes the supplied string attribute value. Unescapes escaped characters. If escaped character is a hex value, it is decoded.- Parameters:
value
- to decode- Returns:
- decoded string
-
readToChar
Deprecated.Reads the supplied string starting at the supplied position until one of the supplied characters is found. Characters escaped with '\' are ignored.- Parameters:
s
- to readchars
- to matchpos
- to start reading at- Returns:
- string index that matched a character or the last index in the string
-
DnParser