Nitido Inc.

com.nitido.nimx.nuggets.pab
Class PABEntry

java.lang.Object
  extended by com.nitido.nimx.nuggets.pab.PABEntry
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
PABGroup, PABPerson

public abstract class PABEntry
extends java.lang.Object
implements java.io.Serializable

The parent of PABGroup and PABPerson. It handles attributes that are common to both classes. However, it is not intended to be instantiated directly.

The backend storage requires two compulsory fields: UNIQUE_NAME and COMMON_NAMES. At least one value must be assigned to each of these two attributes.

The constant strings declared in this class are the attribute names for PAB Person. Any constant name ends in plural form (ie. S) implies that the corresponding attribute is a multi-value attribute. Otherwise, it is a single value attribute.

See Also:
Serialized Form

Field Summary
static java.lang.String COMMON_NAMES
          [REQUIRED] Common Name is mapped to LDAP attribute "cn".
static java.lang.String DESCRIPTIONS
          Description is mapped to LDAP attribute "description".
static java.lang.String NICKNAME
          Nickname is mapped to LDAP attribute "nickname".
static java.lang.String PAB_MEMBERS
          PAB Member is mapped to LDAP attribute "memberOfPAB".
static java.lang.String UNIQUE_NAME
          [REQUIRED] UniqueName is mapped to LDAP attribute "un".
 
Constructor Summary
PABEntry(PABEntry entry)
          Copy constructor.
PABEntry(java.lang.String un)
          Convenient constructor.
PABEntry(java.lang.String un, java.lang.String cn)
          Default constructor.
 
Method Summary
 void addAttributeValue(java.lang.String key, java.lang.Object value)
          Append value to the attribute.
abstract  java.lang.Object clone()
           
protected  OpenHashMap getAllAttributes()
          This method returns all the attributes in a multi-value hash table.
 java.util.Enumeration getAttributeNames()
          Get all attribute names that has values assigned.
 java.util.Set getAttributeNamesSet()
          Get all attribute names that has values assigned.
 java.lang.Object getAttributeValue(java.lang.String key)
          Get the first value of the attribute
 java.util.Enumeration getAttributeValues(java.lang.String key)
          Get all values of the attribute.
 java.util.List getAttributeValuesList(java.lang.String key)
          Get all values of the attribute.
 boolean isRequiredAttribute(java.lang.String key)
          A utility method to check whether the specified attribute is required.
 void removeAttribute(java.lang.String key)
          Remove all values of the attribute.
 void removeAttributeValue(java.lang.String key, int index)
          Remove the specified attribute value mapped to the specific key and index.
 void removeAttributeValue(java.lang.String key, java.lang.String value)
          Remove the specified attribute value.
 void replaceAttributeValue(java.lang.String key, int index, java.lang.String value)
          Replace the existing attribute value associated to key at the index with the new value.
 void replaceAttributeValue(java.lang.String key, java.lang.String value)
          Replace any existing attribute values with the new value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNIQUE_NAME

public static final java.lang.String UNIQUE_NAME
[REQUIRED] UniqueName is mapped to LDAP attribute "un".

This is a single-value, case-insensitive string field.

See Also:
Constant Field Values

COMMON_NAMES

public static final java.lang.String COMMON_NAMES
[REQUIRED] Common Name is mapped to LDAP attribute "cn".

This is a multi-value, case-insensitive string field.

See Also:
Constant Field Values

PAB_MEMBERS

public static final java.lang.String PAB_MEMBERS
PAB Member is mapped to LDAP attribute "memberOfPAB".

This is a multi-value, case-insensitive string field.

See Also:
Constant Field Values

DESCRIPTIONS

public static final java.lang.String DESCRIPTIONS
Description is mapped to LDAP attribute "description".

This is a multi-value, case-insensitive string field.

See Also:
Constant Field Values

NICKNAME

public static final java.lang.String NICKNAME
Nickname is mapped to LDAP attribute "nickname".

This is a single-value, case-insensitive string field.

See Also:
Constant Field Values
Constructor Detail

PABEntry

public PABEntry(java.lang.String un)
Convenient constructor. This is usually used when you are modifying an existing entry


PABEntry

public PABEntry(java.lang.String un,
                java.lang.String cn)
Default constructor. This is usually used when you are creating a new entry.

Parameters:
un - Unique name as required by iPlanet products.
cn - Common name of the PAB entry. This field is required by the underlying LDAP schema.

PABEntry

public PABEntry(PABEntry entry)
Copy constructor.

Method Detail

getAllAttributes

protected OpenHashMap getAllAttributes()
This method returns all the attributes in a multi-value hash table.

It is used by PABNugget only.


getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String key)
Get the first value of the attribute

Parameters:
key - The attribute key name.

getAttributeValuesList

public java.util.List getAttributeValuesList(java.lang.String key)
Get all values of the attribute.

Parameters:
key - The attribute key name.
Returns:
A List of objects. The actual class of the object depends on the attribute that you are fetching.

getAttributeValues

public java.util.Enumeration getAttributeValues(java.lang.String key)
Get all values of the attribute.

Parameters:
key - The attribute key name.
Returns:
An Enumeration of objects. The actual class of the object depends on the attribute that you are fetching.

getAttributeNamesSet

public java.util.Set getAttributeNamesSet()
Get all attribute names that has values assigned.


getAttributeNames

public java.util.Enumeration getAttributeNames()
Get all attribute names that has values assigned.


addAttributeValue

public void addAttributeValue(java.lang.String key,
                              java.lang.Object value)
Append value to the attribute.

Parameters:
key - The attribute key name.
value - The new value.

removeAttributeValue

public void removeAttributeValue(java.lang.String key,
                                 java.lang.String value)
Remove the specified attribute value.

If the specified value does not exists, nothing would be changed and no exception will be thrown.

Parameters:
key - The attribute key name.
value - The value to be removed..

removeAttributeValue

public void removeAttributeValue(java.lang.String key,
                                 int index)
                          throws InvalidAttributeException
Remove the specified attribute value mapped to the specific key and index. Once removed, all subsequent values will have the index number subtract by one (i.e. move left along the sequence).

If the specified value does not exists, nothing would be changed and no exception will be thrown.

Parameters:
key - The attribute key name.
index - The index of the attribute value to remove The index starts from 0.
Throws:
InvalidAttributeException - This exception is thrown if the specified attribute is a required attribute and the value is the last value the attribute has.

removeAttribute

public void removeAttribute(java.lang.String key)
Remove all values of the attribute.

Parameters:
key - The attribute key name.

replaceAttributeValue

public void replaceAttributeValue(java.lang.String key,
                                  java.lang.String value)
Replace any existing attribute values with the new value.

Parameters:
key - The attribute key name.
value - The new value.

replaceAttributeValue

public void replaceAttributeValue(java.lang.String key,
                                  int index,
                                  java.lang.String value)
Replace the existing attribute value associated to key at the index with the new value. All other values remains unchanged

Parameters:
key - The attribute key.
index - The index of the attribute value to be replaced. The index starts from 0.
value - The new value.

isRequiredAttribute

public boolean isRequiredAttribute(java.lang.String key)
A utility method to check whether the specified attribute is required.


clone

public abstract java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.