public class LDAPDN
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static char[] |
DN_ESCAPED_CHAR
Array of the characters that may be escaped in a DN.
|
| Constructor and Description |
|---|
LDAPDN()
Constructs an empty
LDAPDN object. |
LDAPDN(java.lang.String dn)
Constructs a
LDAPDN object from the specified
distinguished name. |
| Modifier and Type | Method and Description |
|---|---|
void |
addRDN(LDAPRDN rdn) |
void |
addRDNToBack(LDAPRDN rdn)
Adds the specified relative distinguished name (RDN) to the
end of the current DN.
|
void |
addRDNToFront(LDAPRDN rdn)
Adds the specified relative distinguished name (RDN) to the
beginning of the current DN.
|
static java.lang.String |
dnBackslashDeNormalizer(java.lang.String dn) |
static java.lang.String |
dnNormalizer(java.lang.String dn)
Normalize dn by:
1) Remove extra write space;
2) LDAPv2 to LDAPv3
For Example:
ou= "One, Two, Three, GO!" , o = radiant logic
and always return the following:
ou=\"One\, Two\, Three\, GO!\",o=radiant logic
|
boolean |
equals(java.lang.Object o) |
static java.lang.String |
getParent(java.lang.String dn) |
LDAPDN |
getParentDN() |
java.lang.String |
getParentDNString() |
LDAPRDN |
getRDN() |
LDAPRDN |
getRDN(int index) |
static java.lang.String |
getRdn(java.lang.String dn) |
java.util.Vector<LDAPRDN> |
getRDNs() |
java.lang.String |
getRDNString() |
int |
hashCode()
Retrieves the hash code for this LDAPDN.
|
boolean |
isDescendantOf(LDAPDN dn) |
static boolean |
isDN(java.lang.String dn)
Determines if the given string is an distinguished name or
not.
|
boolean |
isNullDN() |
static void |
main(java.lang.String[] args) |
static LDAPDN |
nullDN()
Retrieves a singleton instance of the null DN.
|
static java.lang.String |
rdnBackslashDeNormalizer(java.lang.String rdn) |
static java.lang.String |
rdnSpaceNormalizer(java.lang.String rdn) |
int |
size() |
java.lang.String |
toNormalizedString()
Retrieves a normalized string representation of this LDAPDN.
|
java.lang.String |
toString()
Returns the DN in RFC 1485 format.
|
public static final char[] DN_ESCAPED_CHAR
If a value should contain any of the following characters
Character ASCII value Position RFC since ---------------------------------------------------------------------- '#' 0x23 at the beginning 2253, 4514 ' ' 0x20 at the beginning or the end 2253, 4514 '"' 0x22 anywhere 1179 '+' 0x2b anywhere 1179 ',' 0x2c anywhere 1179 ';' 0x3b anywhere 1179 only '<' 0x3c anywhere 1179 '=' 0x3d anywhere 1179, 2253 '>' 0x3e anywhere 1179 '\' 0x5c anywhere 1179 NUL 0x00 anywhere 4514
the character must be prefixed by a backslash '\'. The others, like NULL or non-printable char, must be encoded as the backslash '\' character (ASCII 0x5c) followed by the two hexadecimal digits representing the ASCII value of the encoded character. The case of the two hexadecimal digits is not significant.
public LDAPDN()
LDAPDN object.public LDAPDN(java.lang.String dn)
throws LDAPException
LDAPDN object from the specified
distinguished name. The string representation of the DN
can be in RFC 1485 format.
dn - string representation of the distinguished nameLDAPExceptionpublic int size()
public LDAPRDN getRDN()
public LDAPRDN getRDN(int index)
public java.util.Vector<LDAPRDN> getRDNs()
public LDAPDN getParentDN()
public void addRDN(LDAPRDN rdn)
public void addRDNToFront(LDAPRDN rdn)
public void addRDNToBack(LDAPRDN rdn)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRDNString()
public java.lang.String getParentDNString()
public static java.lang.String dnNormalizer(java.lang.String dn)
public static java.lang.String dnBackslashDeNormalizer(java.lang.String dn)
public static java.lang.String rdnSpaceNormalizer(java.lang.String rdn)
public static java.lang.String rdnBackslashDeNormalizer(java.lang.String rdn)
public static java.lang.String getParent(java.lang.String dn)
throws LDAPException
LDAPExceptionpublic static java.lang.String getRdn(java.lang.String dn)
throws LDAPException
LDAPExceptionpublic static void main(java.lang.String[] args)
public static boolean isDN(java.lang.String dn)
dn - distinguished nametrue or false.public boolean isNullDN()
public boolean isDescendantOf(LDAPDN dn)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toNormalizedString()
public static LDAPDN nullDN()