|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.LDAPDN
A utility class to facilitate composition and deomposition of distinguished names (DNs).
Specifies methods for manipulating a distinguished name (DN) and a relative distinguished name (RDN).
Constructor Summary | |
LDAPDN()
|
Method Summary | |
static boolean |
equals(java.lang.String dn1,
java.lang.String dn2)
Compares the two strings per the distinguishedNameMatch equality matching (using case-ignore matching). |
static java.lang.String |
escapeRDN(java.lang.String rdn)
Returns the RDN after escaping the characters requiring escaping. |
static java.lang.String[] |
explodeDN(java.lang.String dn,
boolean noTypes)
Returns the individual components of a distinguished name (DN). |
static java.lang.String[] |
explodeRDN(java.lang.String rdn,
boolean noTypes)
Returns the individual components of a relative distinguished name (RDN), normalized. |
static boolean |
isValid(java.lang.String dn)
Returns true if the string conforms to distinguished name syntax. |
static java.lang.String |
normalize(java.lang.String dn)
Returns the DN normalized by removal of non-significant space characters as per RFC 2253, section4. |
static java.lang.String |
unescapeRDN(java.lang.String rdn)
Returns the RDN after unescaping the characters requiring escaping. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LDAPDN()
Method Detail |
public static boolean equals(java.lang.String dn1, java.lang.String dn2)
dn1
- String form of the first DN to compare.
dn2
- String form of the second DN to compare.
public static java.lang.String escapeRDN(java.lang.String rdn)
For example, for the rdn "cn=Acme, Inc", the escapeRDN method returns "cn=Acme\, Inc".
escapeRDN escapes the AttributeValue by inserting '\' before the
following chars: * ',' '+' '"' '\' '<' '>' ';'
'#' if it comes at the beginning of the string, and
' ' (space) if it comes at the beginning or the end of a string.
Note that single-valued attributes can be used because of ambiguity. See
RFC 2253
rdn
- The RDN to escape.
public static java.lang.String[] explodeDN(java.lang.String dn, boolean noTypes)
dn
- The distinguished name, for example, "cn=Babs
Jensen,ou=Accounting,o=Acme,c=US"
noTypes
- If true, returns only the values of the
components and not the names. For example, "Babs
Jensen", "Accounting", "Acme", "US" instead of
"cn=Babs Jensen", "ou=Accounting", "o=Acme", and
"c=US".
public static java.lang.String[] explodeRDN(java.lang.String rdn, boolean noTypes)
rdn
- The relative distinguished name, or in other words,
the left-most component of a distinguished name.
noTypes
- If true, returns only the values of the
components, and not the names of the component, for
example "Babs Jensen" instead of "cn=Babs Jensen".
public static boolean isValid(java.lang.String dn)
dn
- String to evaluate fo distinguished name syntax.
public static java.lang.String normalize(java.lang.String dn)
public static java.lang.String unescapeRDN(java.lang.String rdn)
For example, for the rdn "cn=Acme\, Inc", the unescapeRDN method returns "cn=Acme, Inc".
Note:This function doesn't check for the validity of the RDN string use isValid(String) function to check the validity. The results is undefined for invalid RDN's.
unescapeRDN unescapes the AttributeValue by removing the '\' when the next character fits the following:
rdn
- The RDN to unescape.
isValid(String)
|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |