|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.name.LdapName
A distinguished name implementation for LDAPv3.
Field Summary | |
static LdapName |
EMPTY_LDAP_NAME
|
Constructor Summary | |
LdapName()
Creates the default empty name. |
|
LdapName(java.lang.String dn)
Creates the name by parsing a distinguished name String. |
Method Summary | |
javax.naming.Name |
add(int a_posn,
java.lang.String a_comp)
Adds a single component at a specified position within this name. |
javax.naming.Name |
add(java.lang.String a_comp)
Adds a single component to the end of this name. |
javax.naming.Name |
addAll(int a_posn,
javax.naming.Name a_name)
Adds the components of a name -- in order -- at a specified position within this name. |
javax.naming.Name |
addAll(javax.naming.Name a_suffix)
Adds the components of a name -- in order -- to the end of this name. |
java.lang.Object |
clone()
Generates a new copy of this name. |
int |
compareTo(java.lang.Object an_obj)
Compares this name with another name for order. |
boolean |
endsWith(javax.naming.Name a_name)
Determines whether this name ends with a specified suffix. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
get(int a_posn)
Retrieves a component of this name using 0 based indexing from the right most significant name component to the left least significant name component. |
java.util.Enumeration |
getAll()
Retrieves the components of this name as an enumeration of Strings starting in order from the most significant name component on the right to the least significant name component on the left. |
static DnParser |
getNameParser()
Easy conventient method to get ahold of the NameParser singleton for all distinguished names within the LDAP namespace. |
javax.naming.Name |
getPrefix(int a_posn)
Creates a name whose components consist of a prefix of the components in this name. |
java.lang.String |
getRdn()
Gets the Rdn of this LdapName. |
static java.lang.String |
getRdn(javax.naming.Name a_dn)
Gets the Rdn of a distinguished name. |
javax.naming.Name |
getSuffix(int a_posn)
Creates a name whose components consist of a suffix of the components of this name. |
int |
hashCode()
Gets the hashcode of the string representation of this name. |
boolean |
isEmpty()
Determines whether this name is empty. |
java.lang.Object |
remove(int a_posn)
Removes a component from this name. |
int |
size()
Returns the number of components in this name. |
boolean |
startsWith(javax.naming.Name a_name)
Determines whether this name starts with a specified prefix. |
java.lang.String |
toString()
Overriden to printout the entire LdapName with all name components in comma separated format. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static LdapName EMPTY_LDAP_NAME
Constructor Detail |
public LdapName()
public LdapName(java.lang.String dn) throws javax.naming.NamingException
dn
- the distinguished name as a String.
javax.naming.NamingException
- if a parser cannot be initialized or the name is invalidMethod Detail |
public java.lang.Object clone()
clone
in interface javax.naming.Name
Object.clone()
public int compareTo(java.lang.Object an_obj)
LDAP names contain the most significant component on the right and the least significant component on the left. This fact must be considered while comparing name components lexographically to determine the correct ordering of names.
Case is NOT ignored while matching names. Matching rules in an LDAP schema are needed to correctly determine whether case matters or not. Every attribute in the name is presumed to take on the IA5String syntax which does not ignore case while matching. Note that rather than ignore case here we let normalization occur before hand which will make case irrelavent to begin with before this comarison is made. So matching for case is a good idea here.
compareTo
in interface javax.naming.Name
an_obj
- the non-null object to compare against.
java.lang.ClassCastException
- if obj is not a Name of a type that may be
compared with this nameComparable.compareTo(Object)
public int size()
size
in interface javax.naming.Name
public boolean isEmpty()
isEmpty
in interface javax.naming.Name
public java.util.Enumeration getAll()
getAll
in interface javax.naming.Name
public java.lang.String get(int a_posn)
get
in interface javax.naming.Name
a_posn
- the 0-based index of the component to retrieve. Must be in the
range [0,size()).
java.lang.ArrayIndexOutOfBoundsException
- if posn is outside the specified rangepublic javax.naming.Name getSuffix(int a_posn)
getSuffix
in interface javax.naming.Name
a_posn
- the 0-based index of the component at which to stop. Must be
in the range [0,size()].
java.lang.ArrayIndexOutOfBoundsException
- if posn is outside the specified rangepublic javax.naming.Name getPrefix(int a_posn)
getPrefix
in interface javax.naming.Name
a_posn
- the 0-based index of the component at which to start. Must be
in the range [0,size()].
java.lang.IndexOutOfBoundsException
- if posn is outside the specified rangepublic boolean startsWith(javax.naming.Name a_name)
startsWith
in interface javax.naming.Name
a_name
- the name to check
public boolean endsWith(javax.naming.Name a_name)
endsWith
in interface javax.naming.Name
a_name
- the name to check
public javax.naming.Name addAll(javax.naming.Name a_suffix) throws javax.naming.InvalidNameException
addAll
in interface javax.naming.Name
a_suffix
- the components to add
javax.naming.InvalidNameException
- if suffix is not a valid name, or if the addition
of the components would violate the syntax rules of this namepublic javax.naming.Name addAll(int a_posn, javax.naming.Name a_name) throws javax.naming.InvalidNameException
addAll
in interface javax.naming.Name
a_name
- the components to adda_posn
- the index in this name at which to add the new components.
Must be in the range [0,size()].
java.lang.ArrayIndexOutOfBoundsException
- if posn is outside the specified range
javax.naming.InvalidNameException
- if n is not a valid name, or if the addition of
the components would violate the syntax rules of this namepublic javax.naming.Name add(java.lang.String a_comp) throws javax.naming.InvalidNameException
add
in interface javax.naming.Name
a_comp
- the component to add
javax.naming.InvalidNameException
- if adding comp would violate the syntax rules of
this namepublic javax.naming.Name add(int a_posn, java.lang.String a_comp) throws javax.naming.InvalidNameException
add
in interface javax.naming.Name
a_comp
- the component to adda_posn
- the index at which to add the new component. Must be in the
range [0,size()].
java.lang.ArrayIndexOutOfBoundsException
- if posn is outside the specified range
javax.naming.InvalidNameException
- if adding comp would violate the syntax rules of
this namepublic java.lang.Object remove(int a_posn) throws javax.naming.InvalidNameException
remove
in interface javax.naming.Name
a_posn
- the index of the component to remove. Must be in the range
[0,size()).
java.lang.IndexOutOfBoundsException
- if posn is outside the specified range
javax.naming.InvalidNameException
- if deleting the component would violate the syntax rules of
the namepublic java.lang.String toString()
public boolean equals(java.lang.Object obj)
Object.equals(java.lang.Object)
public int hashCode()
Object.hashCode()
public static DnParser getNameParser() throws javax.naming.NamingException
javax.naming.NamingException
- if the parser could not be initialized.public java.lang.String getRdn()
public static java.lang.String getRdn(javax.naming.Name a_dn)
a_dn
- the LDAP based Name to get the Rdn of
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |