com.infoengine.util
Class LdapDnNameComponent
java.lang.Object
com.infoengine.util.LdapDnNameComponent
- public class LdapDnNameComponent
- extends Object
Class to parse and validate name components of an ldap dn.
Complies with definition of ldap dn found in rfc2253 (v3).
BNF quoted from rfc2253
"Lightweight Directory Access Protocol (v3)"
section 3
distinguishedName = [name] ; may be empty string
name = name-component *("," name-component)
name-component = attributeTypeAndValue *("+" attributeTypeAndValue)
attributeTypeAndValue = attributeType "=" attributeValue
attributeType = (ALPHA 1*keychar) / oid
keychar = ALPHA / DIGIT / "-"
oid = 1*DIGIT *("." 1*DIGIT)
attributeValue = string
string = *( stringchar / pair )
/ "#" hexstring
/ QUOTATION *( quotechar / pair ) QUOTATION ; only from v2
quotechar = <any character except "\" or QUOTATION >
special = "," / "=" / "+" / "<" / ">" / "#" / ";"
pair = "\" ( special / "\" / QUOTATION / hexpair )
stringchar = <any character except one of special, "\" or QUOTATION >
hexstring = 1*hexpair
hexpair = hexchar hexchar
hexchar = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
/ "a" / "b" / "c" / "d" / "e" / "f"
ALPHA = <any ASCII alphabetic character>
; (decimal 65-90 and 97-122)
DIGIT = <any ASCII decimal digit> ; (decimal 48-57)
QUOTATION = <the ASCII double quotation mark character '"' decimal 34>
attributeType
private String attributeType
attributeValue
private String attributeValue
LdapDnNameComponent
public LdapDnNameComponent()
LdapDnNameComponent
public LdapDnNameComponent(String nameComponent)
throws IEException
setAttributeType
public void setAttributeType(String attributeType)
throws IEException
- Throws:
IEException
getAttributeType
public String getAttributeType()
setAttributeValue
public void setAttributeValue(String attributeValue)
throws IEException
- Throws:
IEException
getAttributeValue
public String getAttributeValue()
toString
public String toString()
equals
public boolean equals(Object o)
isSeparator
public static boolean isSeparator(char c)
isSpecial
public static boolean isSpecial(char c)
isAlpha
public static boolean isAlpha(char c)
isDigit
public static boolean isDigit(char c)
isKeyChar
public static boolean isKeyChar(char c)
isHexChar
public static boolean isHexChar(char c)
isStringChar
public static boolean isStringChar(char c)
isHexPair
public static boolean isHexPair(char c1,
char c2)
isQuoteChar
public static boolean isQuoteChar(char c)
isPair
public static boolean isPair(char c1,
char c2)
validateOID
public static void validateOID(String oid)
throws IEException
- Throws:
IEException
validateAttributeType
public static void validateAttributeType(String type)
throws IEException
- Throws:
IEException
validateAttributeValue
public static void validateAttributeValue(String value)
throws IEException
- Throws:
IEException
throwMalformed
public static void throwMalformed(String key,
Object[] inserts)
throws IEException
- Throws:
IEException