public class NamespaceTools extends Object
| Constructor and Description |
|---|
NamespaceTools() |
| Modifier and Type | Method and Description |
|---|---|
static String[] |
getCompositeComponents(String compositeNameComponent)
Gets the '+' appended components of a composite name component.
|
static String |
getRdnAttribute(String rdn)
Gets the attribute of a single attribute rdn or name component.
|
static String |
getRdnValue(String rdn)
Gets the value of a single name component of a distinguished name.
|
static DN |
getRelativeName(DN ancestor,
DN descendant)
Gets the relative name between an ancestor and a potential descendant.
|
static boolean |
hasCompositeComponents(String name)
Checks to see if a name has name complex name components in it.
|
static String |
inferLdapName(String realm)
Uses the algorithm in RFC
2247 to infer an LDAP name from a Kerberos realm name or a DNS
domain name.
|
static boolean |
isDescendant(DN ancestor,
DN descendant)
Tests to see if a candidate entry is a descendant of a base.
|
static boolean |
isSibling(DN name1,
DN name2)
Checks to see if two names are siblings.
|
public static String getRdnAttribute(String rdn)
rdn - the name componentpublic static String getRdnValue(String rdn)
rdn - the name component to get the value frompublic static boolean isSibling(DN name1, DN name2) throws LdapInvalidDnException
name1 - the first namename2 - the second nameLdapInvalidDnExceptionpublic static boolean isDescendant(DN ancestor, DN descendant)
ancestor - the base ancestordescendant - the candidate to test for descendancypublic static DN getRelativeName(DN ancestor, DN descendant) throws LdapInvalidDnException
ancestor - the normalized distinguished name of the ancestor contextdescendant - the normalized distinguished name of the descendant contextLdapInvalidDnException - if the contexts are not related in the ancestual sensepublic static String inferLdapName(String realm)
realm - the realm or domain namepublic static String[] getCompositeComponents(String compositeNameComponent) throws LdapInvalidDnException
compositeNameComponent - a single name component not a whole nameLdapInvalidDnException - if nameComponent is invalid (starts with a +)public static boolean hasCompositeComponents(String name) throws LdapInvalidDnException
name - The name to checktrue if the name has composite componentsLdapInvalidDnException - If the name is invalidCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.