Package netscape.ldap.util
Class RDN
- java.lang.Object
-
- netscape.ldap.util.RDN
-
- All Implemented Interfaces:
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.- Version:
- 1.0
- See Also:
DN
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
_cesAttributes
static java.lang.String
CES_SYNTAX
-
Constructor Summary
Constructors Constructor Description RDN(java.lang.String rdn)
Constructs a newRDN
object from the specified DN component.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(RDN rdn)
Determines if the current DN component is equal to the specified DN component.java.lang.String[]
explodeRDN(boolean noType)
Deprecated.usetoString
orgetValues
instead.static java.lang.String[]
getAttributesForSyntax(java.lang.String oid)
Returns all attributes registered for the given syntax as aString
Array.static java.lang.String
getAttributeSyntax(java.lang.String attr)
Returns the syntax for the attribute if the given attribute is registered in the internal attribute table.java.lang.String
getType()
Deprecated.usegetTypes()
instead.java.lang.String[]
getTypes()
Returns the attribute types of the DN component.java.lang.String
getValue()
Deprecated.usegetValues()
instead.java.lang.String[]
getValues()
Returns the values of the DN component.boolean
isMultivalued()
Returnstrue
if the RDN is multi-valued.static boolean
isRDN(java.lang.String rdn)
Determines if the specified string is a distinguished name component.static void
registerAttributeSyntax(java.lang.String attr, java.lang.String oid)
Registers the the given attribute for the given syntax in an internal table.java.lang.String
toString()
Returns the string representation of the DN component.static void
unregisterAttributeSyntax(java.lang.String attr)
Removes the the given attribute from the attribute syntax table.
-
-
-
Field Detail
-
_cesAttributes
public static final java.lang.String[] _cesAttributes
-
CES_SYNTAX
public static final java.lang.String CES_SYNTAX
- See Also:
- Constant Field Values
-
-
Method Detail
-
explodeRDN
public java.lang.String[] explodeRDN(boolean noType)
Deprecated.usetoString
orgetValues
instead.Returns the DN component as the first element in an array of strings.- Parameters:
noType
- specifytrue
to ignore the attribute type and equals sign (for example, "cn=") and return only the value- Returns:
- an array of strings representing the DN component.
-
getType
public java.lang.String getType()
Deprecated.usegetTypes()
instead.Returns the attribute type of the DN component.- Returns:
- rdn the attribute type of the DN component.
-
getTypes
public java.lang.String[] getTypes()
Returns the attribute types of the DN component.- Returns:
- rdn the attribute types of the DN component.
-
getValue
public java.lang.String getValue()
Deprecated.usegetValues()
instead.Returns the value of the DN component.- Returns:
- rdn the value of the DN component.
-
getValues
public java.lang.String[] getValues()
Returns the values of the DN component.- Returns:
- rdn the values of the DN component.
-
isMultivalued
public boolean isMultivalued()
Returnstrue
if the RDN is multi-valued.- Returns:
true
if the RDN is multi-valued.
-
toString
public java.lang.String toString()
Returns the string representation of the DN component.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string representation of the DN component.
-
isRDN
public static boolean isRDN(java.lang.String rdn)
Determines if the specified string is a distinguished name component.- Parameters:
rdn
- the string to check- Returns:
true
if the string is a distinguished name 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.- Parameters:
rdn
- the DN component to compare against the current DN component.- Returns:
true
if the two DN components are equal.- See Also:
registerAttributeSyntax(java.lang.String, java.lang.String)
,getAttributeSyntax(java.lang.String)
-
registerAttributeSyntax
public static void registerAttributeSyntax(java.lang.String attr, java.lang.String oid)
Registers the the given attribute for the given syntax in an internal table. This table is used for attribute comparison in theequals()
method.- Parameters:
attr
- the attribute to register.oid
- the syntax to register with the attribute.- See Also:
equals(netscape.ldap.util.RDN)
,unregisterAttributeSyntax(java.lang.String)
,getAttributeSyntax(java.lang.String)
,getAttributesForSyntax(java.lang.String)
-
unregisterAttributeSyntax
public static void unregisterAttributeSyntax(java.lang.String attr)
Removes the the given attribute from the attribute syntax table.- Parameters:
attr
- the attribute to remove.- See Also:
registerAttributeSyntax(java.lang.String, java.lang.String)
,getAttributeSyntax(java.lang.String)
,getAttributesForSyntax(java.lang.String)
-
getAttributeSyntax
public static java.lang.String getAttributeSyntax(java.lang.String attr)
Returns the syntax for the attribute if the given attribute is registered in the internal attribute table.- Parameters:
attr
- the attribute to lookup in the table.- Returns:
- the syntax of the attribute if found, null otherwise.
- See Also:
unregisterAttributeSyntax(java.lang.String)
,registerAttributeSyntax(java.lang.String, java.lang.String)
,getAttributesForSyntax(java.lang.String)
-
getAttributesForSyntax
public static java.lang.String[] getAttributesForSyntax(java.lang.String oid)
Returns all attributes registered for the given syntax as aString
Array.- Parameters:
oid
- the syntax to look up in the table.- Returns:
- all attributes for the given syntax as a
String[]
- See Also:
unregisterAttributeSyntax(java.lang.String)
,registerAttributeSyntax(java.lang.String, java.lang.String)
,getAttributeSyntax(java.lang.String)
-
-