Package org.ldaptive
Class DnParser
- java.lang.Object
-
- org.ldaptive.DnParser
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.List<LdapAttribute>
convertDnToAttributes(java.lang.String dn)
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 java.lang.String
decodeStringValue(java.lang.String value)
Deprecated.Decodes the supplied string attribute value.static java.lang.String
getValue(java.lang.String dn, java.lang.String name)
Deprecated.Returns the RDN value for the attribute type with the supplied name.static java.util.Collection<java.lang.String>
getValues(java.lang.String dn, java.lang.String name)
Deprecated.Returns the RDN values for the attribute type with the supplied name.static java.lang.String
substring(java.lang.String dn, int beginIndex)
Deprecated.Returns a string representation of the supplied DN beginning at the supplied index.static java.lang.String
substring(java.lang.String dn, int beginIndex, int endIndex)
Deprecated.Returns a string representation of the supplied DN beginning at beginIndex (inclusive) and ending at endIndex (exclusive).
-
-
-
Method Detail
-
getValues
public static java.util.Collection<java.lang.String> getValues(java.lang.String dn, java.lang.String name)
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
public static java.lang.String getValue(java.lang.String dn, java.lang.String name)
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
public static java.lang.String substring(java.lang.String dn, int beginIndex)
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:
java.lang.IndexOutOfBoundsException
- if beginIndex is less than 0 or greater than the number of RDNs
-
substring
public static java.lang.String substring(java.lang.String dn, int beginIndex, int endIndex)
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:
java.lang.IndexOutOfBoundsException
- if beginIndex is less than 0, if beginIndex is greater than endIndex, or endIndex is greater than the number of RDNs
-
convertDnToAttributes
public static java.util.List<LdapAttribute> convertDnToAttributes(java.lang.String dn)
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
protected static java.lang.String decodeStringValue(java.lang.String value)
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
-
-