netscape.ldap.util
Class RDN
- java.io.Serializable
public final class RDN
extends java.lang.Object
implements java.io.Serializable
Objects of this class represent the components of a distinguished
name (DN). (In some situations, these components are referred to
as relative distinguished names, or RDNs.) For example, the
DN "uid=bjensen, ou=People, o=Airius.com" has three components:
"uid=bjensen", "ou=People", and "o=Airius.com".
Each DN component consists of an attribute type and a value.
For example, in "o=Airius.com", the attribute type is "o"
and the value is "Airius.com".
You can use objects of this class to add components to an
existing
DN
object.
RDN(String rdn) - Constructs a new
RDN object from the specified
DN component.
|
boolean | equals(RDN rdn) - Determines if the current DN component is equal to the specified
DN component.
|
String[] | explodeRDN(boolean noType) - use
toString or getValues instead.
|
static String | getAttributeSyntax(String attr) - Returns the syntax for the attribute if the given attribute is registered
in the internal attribute table.
|
static String[] | getAttributesForSyntax(String oid) - Returns all attributes registered for the given syntax as a
String Array.
|
String | getType() - use
getTypes() instead.
|
String[] | getTypes() - Returns the attribute types of the DN component.
|
String | getValue() - use
getValues() instead.
|
String[] | getValues() - Returns the values of the DN component.
|
boolean | isMultivalued() - Returns
true if the RDN is multi-valued.
|
static boolean | isRDN(String rdn) - Determines if the specified string is a distinguished name component.
|
static void | registerAttributeSyntax(String attr, String oid) - Registers the the given attribute for the given syntax in an
internal table.
|
String | toString() - Returns the string representation of the DN component.
|
static void | unregisterAttributeSyntax(String attr) - Removes the the given attribute from the attribute syntax table.
|
CES_SYNTAX
public static final String CES_SYNTAX
_cesAttributes
public static final String[] _cesAttributes
RDN
public RDN(String rdn)
Constructs a new RDN
object from the specified
DN component.
equals
public boolean equals(RDN rdn)
Determines if the current DN component is equal to the specified
DN component. Uses an internal table of ces (case exact string)
attributes to determine how the attributes should be compared.
rdn
- the DN component to compare against the
current DN component.
true
if the two DN components are equal.
explodeRDN
public String[] explodeRDN(boolean noType)
use toString
or getValues
instead.
Returns the DN component as the first element in an
array of strings.
noType
- specify true
to ignore the attribute type and
equals sign (for example, "cn=") and return only the value
- an array of strings representing the DN component.
getAttributeSyntax
public static String getAttributeSyntax(String attr)
Returns the syntax for the attribute if the given attribute is registered
in the internal attribute table.
attr
- the attribute to lookup in the table.
- the syntax of the attribute if found, null otherwise.
getAttributesForSyntax
public static String[] getAttributesForSyntax(String oid)
Returns all attributes registered for the given syntax as a
String
Array.
oid
- the syntax to look up in the table.
- all attributes for the given syntax as a
String[]
getType
public String getType()
use getTypes()
instead.
Returns the attribute type of the DN component.
- rdn the attribute type of the DN component.
getTypes
public String[] getTypes()
Returns the attribute types of the DN component.
- rdn the attribute types of the DN component.
getValue
public String getValue()
use getValues()
instead.
Returns the value of the DN component.
- rdn the value of the DN component.
getValues
public String[] getValues()
Returns the values of the DN component.
- rdn the values of the DN component.
isMultivalued
public boolean isMultivalued()
Returns true
if the RDN is multi-valued.
true
if the RDN is multi-valued.
isRDN
public static boolean isRDN(String rdn)
Determines if the specified string is a distinguished name component.
rdn
- the string to check
true
if the string is a distinguished name component.
registerAttributeSyntax
public static void registerAttributeSyntax(String attr,
String oid)
Registers the the given attribute for the given syntax in an
internal table. This table is used for attribute comparison in the
equals()
method.
attr
- the attribute to register.oid
- the syntax to register with the attribute.
toString
public String toString()
Returns the string representation of the DN component.
- the string representation of the DN component.
unregisterAttributeSyntax
public static void unregisterAttributeSyntax(String attr)
Removes the the given attribute from the attribute syntax table.
attr
- the attribute to remove.