|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.util.DN
public class DN
A DN encapsulates a Distinguished Name (an ldap name with context). A DN does not need to be fully distinguished, or extend to the Root of a directory. It provides methods to get information about the DN and to manipulate the DN.
The following are examples of valid DN:
Note: Multivalued attributes are all considered to be one component and are represented in one RDN (see RDN)
RDN
Field Summary | |
---|---|
private static int |
ALPHA_ATTR_TYPE
|
private static int |
HEX_RDN_VALUE
|
private static int |
LOOK_FOR_RDN_ATTR_TYPE
|
private static int |
LOOK_FOR_RDN_VALUE
|
private static int |
OID_ATTR_TYPE
|
private static int |
QUOTED_RDN_VALUE
|
private java.util.ArrayList |
rdnList
|
private static int |
UNQUOTED_RDN_VALUE
|
Constructor Summary | |
---|---|
DN()
|
|
DN(java.lang.String dnString)
Constructs a new DN based on the specified string representation of a distinguished name. |
Method Summary | |
---|---|
void |
addRDN(RDN rdn)
Adds the RDN to the beginning of the current DN. |
void |
addRDNToBack(RDN rdn)
Adds the RDN to the end of the current DN |
void |
addRDNToFront(RDN rdn)
Adds the RDN to the beginning of the current DN. |
int |
countRDNs()
Retrieves the count of RDNs, or individule names, in the Distinguished name |
boolean |
equals(DN toDN)
Compares this DN to the specified DN to determine if they are equal. |
java.lang.String[] |
explodeDN(boolean noTypes)
return a string array of the individual RDNs contained in the DN |
DN |
getParent()
Returns the Parent of this DN |
java.util.Vector |
getRDNs()
Retrieves a list of RDN Objects, or individual names of the DN |
private static char |
hexToChar(char hex1,
char hex0)
Converts two valid hex digit characters that form the string representation of an ascii character value to the actual ascii character. |
private boolean |
isAlpha(char ch)
Checks a character to see if it is an ascii alphabetic character in ranges 65-90 or 97-122. |
boolean |
isDescendantOf(DN containerDN)
Determines if this DN is contained by the DN passed in. |
private boolean |
isDigit(char ch)
Checks a character to see if it is an ascii digit (0-9) character in the ascii value range 48-57. |
private static boolean |
isHexDigit(char ch)
Checks a character to see if it is valid hex digit 0-9, a-f, or A-F (ASCII value ranges 48-47, 65-70, 97-102). |
private boolean |
needsEscape(char ch)
Checks a character to see if it must always be escaped in the string representation of a DN. |
java.lang.String |
toString()
Creates and returns a string that represents this DN. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int LOOK_FOR_RDN_ATTR_TYPE
private static final int ALPHA_ATTR_TYPE
private static final int OID_ATTR_TYPE
private static final int LOOK_FOR_RDN_VALUE
private static final int QUOTED_RDN_VALUE
private static final int HEX_RDN_VALUE
private static final int UNQUOTED_RDN_VALUE
private java.util.ArrayList rdnList
Constructor Detail |
---|
public DN()
public DN(java.lang.String dnString)
dnString
- a string representation of the distinguished name
java.lang.IllegalArgumentException
- if the the value of the dnString
parameter does not adhere to the syntax described in
RFC 2253Method Detail |
---|
private boolean isAlpha(char ch)
ch
- the character to be tested.
true
if the character is an ascii alphabetic
characterprivate boolean isDigit(char ch)
ch
- the character to be tested.
true
if the character is an ascii alphabetic
characterprivate static boolean isHexDigit(char ch)
ch
- the character to be tested.
true
if the character is a valid hex digitprivate boolean needsEscape(char ch)
ch
- the character to be tested.
true
if the character needs to be escaped in at
least some instances.private static char hexToChar(char hex1, char hex0) throws java.lang.IllegalArgumentException
hex1
- the hex digit for the high order byte.hex0
- the hex digit for the low order byte.
java.lang.IllegalArgumentException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(DN toDN)
toDN
- the DN to compare to
true
if the DNs are equal; otherwise
false
public java.lang.String[] explodeDN(boolean noTypes)
noTypes
- If true, returns only the values of the
components, and not the names, e.g. "Babs
Jensen", "Accounting", "Acme", "us" - instead of
"cn=Babs Jensen", "ou=Accounting", "o=Acme", and
"c=us".
String[]
containing the rdns in the DN with
the leftmost rdn in the first element of the arraypublic int countRDNs()
public java.util.Vector getRDNs()
public boolean isDescendantOf(DN containerDN)
containerDN
- of a container
public DN getParent()
public void addRDN(RDN rdn)
rdn
- an RDN to be addedpublic void addRDNToFront(RDN rdn)
rdn
- an RDN to be addedpublic void addRDNToBack(RDN rdn)
rdn
- an RDN to be added
|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |