Nitido Inc.

com.nitido.nimx.nuggets.pab.stub
Class PABNuggetStub

java.lang.Object
  extended by com.nitido.nim.Nugget
      extended by com.nitido.nim.CachableNugget
          extended by com.nitido.nimx.nuggets.pab.PABNugget
              extended by com.nitido.nimx.nuggets.pab.stub.PABNuggetStub
All Implemented Interfaces:
java.io.Serializable

public class PABNuggetStub
extends PABNugget

Personal Address Book Nugget provides services for accessing and modifying a user's address book. It assume that the backend is LDAP directory type of data storage.

This nugget encapsulate the information of the address group and personal information with PABGroup and PABNugget classes. You should refer to the JavaDoc of these two classes for a detail list of infromation supported by them.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable _entries
           
protected static java.lang.String ADDR_BOOK_UN
           
protected static java.lang.String AT_OBJ_CLASS
           
protected static java.lang.String AT_PAB
           
static java.lang.String GROUP
           
static java.lang.String HOMER
          The UN of a default PABPerson entry "test-homer".
static java.lang.String MARGE
           
 
Fields inherited from class com.nitido.nim.Nugget
_entity, _nim, _nuggetName, _settings
 
Constructor Summary
PABNuggetStub(NuggetVisa visa)
          Default Nugget constructor.
 
Method Summary
 PABBatchResult addEntries(PABEntry[] entries)
          Add a large number of entries in one batch.
 java.lang.String addEntry(PABEntry entry)
          Add a new PAB entry.
 java.util.Vector getEmailAddresses(java.lang.String entryUN)
          Resolve the specified unique name into a vector of email addresses.
 java.util.Enumeration getEntries()
          Return all entries that has been stored.
 java.util.Enumeration getEntries(java.lang.String filter)
          Return empty enumeration if the filter starts with "( &".
 PABEntry getEntry(java.lang.String un)
          Return the matched PABEntry.
 PABGroup getGroup(java.lang.String un)
          Return the matched PABGroup.
 java.util.Enumeration getGroupMembers(java.lang.String groupUN)
          Get the Unique Name of members belong to the group
 java.lang.String getGroupObjectClass()
          Get the "objectclass" string that will be used by a PAB group LDAP entry.
 PABPerson getPerson(java.lang.String un)
          Return the matched PABPerson.
 java.lang.String getPersonObjectClass()
          Get the "objectclass" string that will be used by a PAB person LDAP entry.
 void initImpl()
          Used by NiM Nugget mechanism.
 void modifyEntry(PABEntry entry)
          Replace an existing PAB entry with the new one.
 void removeEntry(PABEntry entry)
          Remove an existing PAB entry.
 void removeFromGroup(java.lang.String groupUN, java.lang.String personUN)
          Remove the specified PABEntry from the group.
protected  void setGroupFixedAttributes(PABEntry entry)
           
 void setGroupMembers(java.lang.String groupUN, java.util.Vector personUNs)
          Set the group member of a group.
 void setGroups(java.util.Vector groupUNs, java.lang.String personUN)
          Set the groups that the specified entryDN belongs to.
protected  void setPersonFixedAttributes(PABEntry entry)
           
 
Methods inherited from class com.nitido.nimx.nuggets.pab.PABNugget
activate, deactivate, generateNewCN, generateNewUN, getDescriptor
 
Methods inherited from class com.nitido.nim.CachableNugget
isCachable
 
Methods inherited from class com.nitido.nim.Nugget
destroy, destroyImpl, getEntity, getNuggetName, getSetting, getSettings, init, requestBegin, requestEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_entries

protected java.util.Hashtable _entries

ADDR_BOOK_UN

protected static final java.lang.String ADDR_BOOK_UN
See Also:
Constant Field Values

AT_OBJ_CLASS

protected static final java.lang.String AT_OBJ_CLASS
See Also:
Constant Field Values

AT_PAB

protected static final java.lang.String AT_PAB
See Also:
Constant Field Values

HOMER

public static final java.lang.String HOMER
The UN of a default PABPerson entry "test-homer".

See Also:
Constant Field Values

MARGE

public static final java.lang.String MARGE
See Also:
Constant Field Values

GROUP

public static final java.lang.String GROUP
See Also:
Constant Field Values
Constructor Detail

PABNuggetStub

public PABNuggetStub(NuggetVisa visa)
Default Nugget constructor.

Method Detail

initImpl

public void initImpl()
Description copied from class: PABNugget
Used by NiM Nugget mechanism. An application developer should never invoke this.

Specified by:
initImpl in class PABNugget

setPersonFixedAttributes

protected void setPersonFixedAttributes(PABEntry entry)

setGroupFixedAttributes

protected void setGroupFixedAttributes(PABEntry entry)

getPerson

public PABPerson getPerson(java.lang.String un)
Return the matched PABPerson.

Specified by:
getPerson in class PABNugget
Parameters:
un - The unique name of the PABPerson.

getGroup

public PABGroup getGroup(java.lang.String un)
Return the matched PABGroup.

Specified by:
getGroup in class PABNugget
Parameters:
un - The unique name of the PABGroup.

getEntry

public PABEntry getEntry(java.lang.String un)
Return the matched PABEntry.

Specified by:
getEntry in class PABNugget
Parameters:
un - The unique name of the PABEntry.

getEntries

public java.util.Enumeration getEntries()
Return all entries that has been stored.

Specified by:
getEntries in class PABNugget

getEntries

public java.util.Enumeration getEntries(java.lang.String filter)
Return empty enumeration if the filter starts with "( &". Otherwise, return all entries that has been stored.

Specified by:
getEntries in class PABNugget
Parameters:
filter - The filter string.

addEntries

public PABBatchResult addEntries(PABEntry[] entries)
                          throws InvalidEntryException,
                                 PABException
Description copied from class: PABNugget
Add a large number of entries in one batch. This method is mainly used for importing address book.

Specified by:
addEntries in class PABNugget
Parameters:
entries - The list of PABEntry objects to be added.
Returns:
If successful, this method will return the "un" (UNIQUE_NAME) of the new entry.
Throws:
PABException - Major problem at the backend (such as major IO exception). For other entry specific errors, this method will only indicate those error codes in the PABBatchResult object instead of throwing an exception.
InvalidEntryException

addEntry

public java.lang.String addEntry(PABEntry entry)
                          throws InvalidEntryException,
                                 PABException
Description copied from class: PABNugget
Add a new PAB entry.

Specified by:
addEntry in class PABNugget
Parameters:
entry - The entry to be added. A new entry does not require the un specified (i.e. just pass "" to the un parameter when you construct the object).
Returns:
If successful, this method will return the "un" (UNIQUE_NAME) of the new entry.
Throws:
InvalidEntryException - Thrown when another entry with the same unique name already exists.
PABException

modifyEntry

public void modifyEntry(PABEntry entry)
                 throws InvalidEntryException,
                        PABException
Description copied from class: PABNugget
Replace an existing PAB entry with the new one.

Specified by:
modifyEntry in class PABNugget
Parameters:
entry - The entry to be replaced.
Throws:
InvalidEntryException - If the specified entry does not exist.
PABException

removeEntry

public void removeEntry(PABEntry entry)
                 throws InvalidEntryException,
                        PABException
Description copied from class: PABNugget
Remove an existing PAB entry.

If it is a PABGroup, this will remove the links to child PABEntry that it contains. However, it would not attempt to remove them from the system completely.

Specified by:
removeEntry in class PABNugget
Parameters:
entry - The entry to be removed.
Throws:
InvalidEntryException - If the specified entry does not exist.
PABException

setGroups

public void setGroups(java.util.Vector groupUNs,
                      java.lang.String personUN)
               throws InvalidEntryException,
                      PABException
Description copied from class: PABNugget
Set the groups that the specified entryDN belongs to.

Specified by:
setGroups in class PABNugget
Parameters:
groupUNs - The unique name of groups that the entry is going to be added to.
personUN - The unique name of the entry to be added.
Throws:
InvalidEntryException - If the entry or one of the specified groups does not exist.
PABException

setGroupMembers

public void setGroupMembers(java.lang.String groupUN,
                            java.util.Vector personUNs)
                     throws PABException
Description copied from class: PABNugget
Set the group member of a group.

Specified by:
setGroupMembers in class PABNugget
Parameters:
groupUN - The unique name of the target group
personUNs - The UNs of the PAB persons to be added to the group.
Throws:
PABException - PB problem

removeFromGroup

public void removeFromGroup(java.lang.String groupUN,
                            java.lang.String personUN)
                     throws InvalidEntryException,
                            PABException
Description copied from class: PABNugget
Remove the specified PABEntry from the group.

Specified by:
removeFromGroup in class PABNugget
Parameters:
groupUN - The unique name of the group that the entry is going to be removed to.
personUN - The unique name of the entry to be added.
Throws:
InvalidEntryException - If the entry or the group does not exist.
PABException

getGroupMembers

public java.util.Enumeration getGroupMembers(java.lang.String groupUN)
                                      throws InvalidEntryException,
                                             PABException
Description copied from class: PABNugget
Get the Unique Name of members belong to the group

Specified by:
getGroupMembers in class PABNugget
Parameters:
groupUN - The unique name of the group
Returns:
An Enumeration of PABPerson objects that belongs to the group.
Throws:
InvalidEntryException - If the entry does not exist.
PABException

getEmailAddresses

public java.util.Vector getEmailAddresses(java.lang.String entryUN)
Description copied from class: PABNugget
Resolve the specified unique name into a vector of email addresses.

If it is a person, it will return the email of the corresponding person (if it is specified).

If it is a group, it will return the email addresses of ALL members.

Specified by:
getEmailAddresses in class PABNugget
Returns:
A vector of String with the emails in the format:

"Display Name" 
If no matches, an empty vector.

getGroupObjectClass

public java.lang.String getGroupObjectClass()
Description copied from class: PABNugget
Get the "objectclass" string that will be used by a PAB group LDAP entry. This string is used to differentiate a PAB group entry from a PAB person entry in the LDAP server. It is usually used for constructing the LDAP search filter string for invoking the method getEntries( String filter ).

Specified by:
getGroupObjectClass in class PABNugget
Returns:
The LDAP "ObjectClass" string for PAB group.

getPersonObjectClass

public java.lang.String getPersonObjectClass()
Description copied from class: PABNugget
Get the "objectclass" string that will be used by a PAB person LDAP entry. This string is used to differentiate a PAB person entry from a PAB group entry in the LDAP server. It is usually used for constructing the LDAP search filter string for invoking the method getEntries( String filter ).

Specified by:
getPersonObjectClass in class PABNugget
Returns:
The LDAP "ObjectClass" string for PAB person.

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.