|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.util.NamespaceTools
public class NamespaceTools
Tools dealing with common Naming operations.
Constructor Summary | |
---|---|
NamespaceTools()
|
Method Summary | |
---|---|
static String[] |
getCompositeComponents(String compositeNameComponent)
Gets the '+' appended components of a composite name component. |
static String |
getLastComponent(String a_name)
Fast and efficiently get last index of a comma from a_name and return substring from comma to end of the string. |
static String |
getNamespaceString(Name a_name)
Generates the string representation of a name. |
static String |
getNamespaceString(String a_base,
Name a_name)
Generates the string representation of a name off of a base prefix. |
static String |
getParent(String a_childDN)
Given a child distinguished name this method gets the distinguished name of the parent. |
static String |
getRdn(String a_name)
Quickly splits off the relative distinguished name component. |
static String |
getRdnAttribute(String a_rdn)
Gets the attribute of a single attribute rdn or name component. |
static String |
getRdnValue(String a_rdn)
Gets the value of a single name component of a distinguished name. |
static Name |
getRelativeName(Name ancestor,
Name 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(Name a_ancestor,
Name a_descendant)
Tests to see if a candidate entry is a descendant of a base. |
static boolean |
isRoot(String a_dn)
Checks to see if a distinguished name is a root. |
static boolean |
isSibling(Name a_name1,
Name a_name2)
Checks to see if two names are siblings. |
static String |
setRdn(String a_name,
String a_rdn)
Sets the rdn of a distinguished name string. |
String |
toLowerAttributeType(String nameComponent)
Lowercases the attribute of a complex name component or a simple one with a single attribute value pair. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamespaceTools()
Method Detail |
---|
public static boolean isRoot(String a_dn) throws InvalidNameException
a_dn
- distinguished name to test.
InvalidNameException
- if a_dn is not syntactically correctlypublic static String getParent(String a_childDN) throws InvalidNameException
a_childDN
- the distinguished name of the child.
InvalidNameException
- if dn is not syntactically correctlypublic static String getNamespaceString(Name a_name) throws InvalidNameException
a_name
- the Name object to convert to a string.
InvalidNameException
- if the name is a federated composite name.public static String getNamespaceString(String a_base, Name a_name) throws InvalidNameException
a_base
- the prefix of the name.a_name
- the name to add to the prefix.
InvalidNameException
- if the name is a federated composite name or if a_base is an
invalid DN.public static String getLastComponent(String a_name)
a_name
- the name from which the last component is to be extracted.
public static String getRdn(String a_name)
a_name
- the distinguished name or a name fragment
public static String setRdn(String a_name, String a_rdn)
a_name
- the distinguished name to append the rdn toa_rdn
- the relative distinguished name to append
public static String getRdnAttribute(String a_rdn)
a_rdn
- the name component
public static String getRdnValue(String a_rdn)
a_rdn
- the name component to get the value from
public static boolean isSibling(Name a_name1, Name a_name2)
a_name1
- the first namea_name2
- the second name
public static boolean isDescendant(Name a_ancestor, Name a_descendant)
a_ancestor
- the base ancestora_descendant
- the candidate to test for descendancy
public static Name getRelativeName(Name ancestor, Name descendant) throws NamingException
ancestor
- the normalized distinguished name of the ancestor contextdescendant
- the normalized distinguished name of the descendant context
NamingException
- if the contexts are not related in the ancestual sensepublic static String inferLdapName(String realm)
realm
- the realm or domain name
public static String[] getCompositeComponents(String compositeNameComponent) throws NamingException
compositeNameComponent
- a single name component not a whole name
NamingException
- if nameComponent is invalid (starts with a +)public static boolean hasCompositeComponents(String name) throws NamingException
name
- The name to check
true
if the name has composite components
NamingException
- If the name is invalidpublic String toLowerAttributeType(String nameComponent) throws NamingException
nameComponent
- the name component to lower the case of attribute types
NamingException
- if the component is malformed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |