LDAP Classes
Implements Java LDAP

com.novell.ldap.util
Class RDN

java.lang.Object
  extended bycom.novell.ldap.util.RDN

public class RDN
extends java.lang.Object

A RDN encapsulates a single object's name of a Distinguished Name(DN). The object name represented by this class contains no context. Thus a Relative Distinguished Name (RDN) could be relative to anywhere in the Directories tree.

For example, of following DN, 'cn=admin, ou=marketing, o=corporation', all possible RDNs are 'cn=admin', 'ou=marketing', and 'o=corporation'.

Multivalued attributes are encapsulated in this class. For example the following could be represented by an RDN: 'cn=john + l=US', or 'cn=juan + l=ES'

See Also:
DN

Constructor Summary
RDN()
           
RDN(java.lang.String rdn)
          Creates an RDN object from the DN component specified in the string RDN
 
Method Summary
 void add(java.lang.String attrType, java.lang.String attrValue, java.lang.String rawValue)
          Adds another value to the RDN.
 boolean equals(RDN rdn)
          Compares the RDN to the rdn passed.
 java.lang.String[] explodeRDN(boolean noTypes)
          Returns each multivalued name in the current RDN as an array of Strings.
protected  java.lang.String getRawValue()
          Returns the actually Raw String before Normalization
 java.lang.String getType()
          Returns the type of this RDN.
 java.lang.String[] getTypes()
          Returns all the types for this RDN.
 java.lang.String getValue()
          Returns the values of this RDN.
 java.lang.String[] getValues()
          Returns all the types for this RDN.
 boolean isMultivalued()
          Determines if this RDN is multivalued or not
 java.lang.String toString()
          Creates a string that represents this RDN, according to RFC 2253
 java.lang.String toString(boolean noTypes)
          Creates a string that represents this RDN.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RDN

public RDN(java.lang.String rdn)
Creates an RDN object from the DN component specified in the string RDN

Parameters:
rdn - the DN component

RDN

public RDN()
Method Detail

equals

public boolean equals(RDN rdn)
Compares the RDN to the rdn passed. Note: If an there exist any mulivalues in one RDN they must all be present in the other.

Parameters:
rdn - the RDN to compare to
Throws:
java.lang.IllegalArgumentException - if the application compares a name with an OID.

getRawValue

protected java.lang.String getRawValue()
Returns the actually Raw String before Normalization

Returns:
The raw string

add

public void add(java.lang.String attrType,
                java.lang.String attrValue,
                java.lang.String rawValue)
Adds another value to the RDN. Only one attribute type is allowed for the RDN.

Parameters:
attrType - Attribute type, could be an OID or String
attrValue - Attribute Value, must be normalized and escaped
rawValue - or text before normalization, can be Null

toString

public java.lang.String toString()
Creates a string that represents this RDN, according to RFC 2253

Returns:
An RDN string

toString

public java.lang.String toString(boolean noTypes)
Creates a string that represents this RDN. If noTypes is true then Atribute types will be ommited.

Parameters:
noTypes - true if attribute types will be omitted.
Returns:
An RDN string

explodeRDN

public java.lang.String[] explodeRDN(boolean noTypes)
Returns each multivalued name in the current RDN as an array of Strings.

Parameters:
noTypes - Specifies whether Attribute types are included. The attribute type names will be ommitted if the parameter noTypes is true.
Returns:
List of multivalued Attributes

getType

public java.lang.String getType()
Returns the type of this RDN. This method assumes that only one value is used, If multivalues attributes are used only the first Type is returned. Use GetTypes.

Returns:
Type of attribute

getTypes

public java.lang.String[] getTypes()
Returns all the types for this RDN.

Returns:
list of types

getValue

public java.lang.String getValue()
Returns the values of this RDN. If multivalues attributes are used only the first Type is returned. Use GetTypes.

Returns:
Type of attribute

getValues

public java.lang.String[] getValues()
Returns all the types for this RDN.

Returns:
list of types

isMultivalued

public boolean isMultivalued()
Determines if this RDN is multivalued or not

Returns:
true if this RDN is multivalued

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000