com.infoengine.util
Class LdapDnNameComponent

java.lang.Object
  extended bycom.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>


Field Summary
private  String attributeType
           
private  String attributeValue
           
 
Constructor Summary
LdapDnNameComponent()
           
LdapDnNameComponent(String nameComponent)
           
 
Method Summary
 boolean equals(Object o)
           
 String getAttributeType()
           
 String getAttributeValue()
           
static boolean isAlpha(char c)
           
static boolean isDigit(char c)
           
static boolean isHexChar(char c)
           
static boolean isHexPair(char c1, char c2)
           
static boolean isKeyChar(char c)
           
static boolean isPair(char c1, char c2)
           
static boolean isQuoteChar(char c)
           
static boolean isSeparator(char c)
           
static boolean isSpecial(char c)
           
static boolean isStringChar(char c)
           
 void setAttributeType(String attributeType)
           
 void setAttributeValue(String attributeValue)
           
static void throwMalformed(String key, Object[] inserts)
           
 String toString()
           
static void validateAttributeType(String type)
           
static void validateAttributeValue(String value)
           
static void validateOID(String oid)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attributeType

private String attributeType

attributeValue

private String attributeValue
Constructor Detail

LdapDnNameComponent

public LdapDnNameComponent()

LdapDnNameComponent

public LdapDnNameComponent(String nameComponent)
                    throws IEException
Method Detail

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