com.sun.im.service
Interface PersonalStoreService


public interface PersonalStoreService

The PersonalStore Service The service should be intialized by calling intialize() before using any of the methods.


Field Summary
static int MAIL_ATTRIBUTE
          search on mail attribute
static int NAME_ATTRIBUTE
          search on name attribute
static int SEARCHTYPE_BYUID
          Deprecated. use SEARCHTYPE_EQUALS
static int SEARCHTYPE_CONTAINS
          search by contain name
static int SEARCHTYPE_ENDSWITH
          search by end with name
static int SEARCHTYPE_EQUALS
          equals
static int SEARCHTYPE_STARTSWITH
          search by start with name
static int UID_ATTRIBUTE
          search on uid attribute
 
Method Summary
 void addPersonalStoreServiceListener(PersonalStoreServiceListener listener)
          Add an additional PersonalStoreServiceListener to receive the event notifications.
 PersonalStoreEntry createEntry(CollaborationPrincipal principal, java.lang.String entryType, java.lang.String displayName)
          creates a new entry on behalf of a specified user This method does not necessarily commit the entry to permanent storage.
 PersonalStoreEntry createEntry(java.lang.String entryType, java.lang.String displayName)
          creates a new entry This method does not necessarily commit the entry to permanent storage.
 java.util.Collection getEntries(java.lang.String entryType)
          retrieves all entries of a specific type from the personal store note: this assumes there aren't too many folders in the personal store
 PersonalStoreEntry getEntry(CollaborationPrincipal principal, java.lang.String EntryType, java.lang.String entryId)
          retrieves a personal store entry from its entry id
 PersonalStoreEntry getEntry(java.lang.String EntryType, java.lang.String entryId)
          retrieves a personal store entry from its entry id
 java.util.Collection getFolders(CollaborationPrincipal principal, java.lang.String entryType)
          retrieves all the folders in the personal store of a specified principal note: this assumes there aren't too many folders in the personal store
 java.util.Collection getFolders(java.lang.String entryType)
          retrieves all the folders in the personal store note: this assumes there aren't too many folders in the personal store
 PersonalProfile getProfile()
          get the profile info
 PersonalProfile getProfile(CollaborationPrincipal principal)
          get the profile info
 void initialize(PersonalStoreServiceListener listener)
          intialize the service by providing a PersonalStoreServiceListener.
 void removePersonalStoreServiceListener(PersonalStoreServiceListener listener)
          Removes an already added ConfereneServiceListener.
 void save()
          Commit unsaved personal store changes to the server
 PersonalStoreEntry[] search(int searchType, java.lang.String pattern, java.lang.String entryType)
          search directory for entry This method search the corporate directory for entries that can then be used to add as a PersonalContact to the PersonalStoreFolder.
 PersonalStoreEntry[] search(int searchType, java.lang.String pattern, java.lang.String entryType, int attribute)
           
 CollaborationPrincipal[] searchPrincipals(int searchType, java.lang.String pattern)
          search directory for entry This method search the corporate directory for entries that can then be used to add as a PersonalContact to the PersonalStoreFolder.
 CollaborationPrincipal[] searchPrincipals(int searchType, java.lang.String pattern, int attribute)
          search directory for entry This method search the corporate directory for entries that can then be used to add as a PersonalContact to the PersonalStoreFolder.
 

Field Detail

SEARCHTYPE_BYUID

public static final int SEARCHTYPE_BYUID
Deprecated. use SEARCHTYPE_EQUALS

search using the uid

See Also:
Constant Field Values

SEARCHTYPE_CONTAINS

public static final int SEARCHTYPE_CONTAINS
search by contain name

See Also:
Constant Field Values

SEARCHTYPE_STARTSWITH

public static final int SEARCHTYPE_STARTSWITH
search by start with name

See Also:
Constant Field Values

SEARCHTYPE_ENDSWITH

public static final int SEARCHTYPE_ENDSWITH
search by end with name

See Also:
Constant Field Values

SEARCHTYPE_EQUALS

public static final int SEARCHTYPE_EQUALS
equals

See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final int NAME_ATTRIBUTE
search on name attribute

See Also:
Constant Field Values

UID_ATTRIBUTE

public static final int UID_ATTRIBUTE
search on uid attribute

See Also:
Constant Field Values

MAIL_ATTRIBUTE

public static final int MAIL_ATTRIBUTE
search on mail attribute

See Also:
Constant Field Values
Method Detail

getEntry

public PersonalStoreEntry getEntry(java.lang.String EntryType,
                                   java.lang.String entryId)
                            throws CollaborationException
retrieves a personal store entry from its entry id

Parameters:
entryId - entry's unique id
Returns:
entry if found.
Throws:
CollaborationException

getEntry

public PersonalStoreEntry getEntry(CollaborationPrincipal principal,
                                   java.lang.String EntryType,
                                   java.lang.String entryId)
                            throws CollaborationException
retrieves a personal store entry from its entry id

Parameters:
entryId - entry's unique id
principal - owner of the personal store to query
Returns:
entry if found.
Throws:
CollaborationException

getEntries

public java.util.Collection getEntries(java.lang.String entryType)
                                throws CollaborationException
retrieves all entries of a specific type from the personal store note: this assumes there aren't too many folders in the personal store

note: retrieves only the folders, not the entries.

Returns:
a Collection of PersonalStoreFolder objects
Throws:
CollaborationException

getFolders

public java.util.Collection getFolders(java.lang.String entryType)
                                throws CollaborationException
retrieves all the folders in the personal store note: this assumes there aren't too many folders in the personal store

note: retrieves only the folders, not the entries.

Returns:
a Collection of PersonalStoreFolder objects
Throws:
CollaborationException

getFolders

public java.util.Collection getFolders(CollaborationPrincipal principal,
                                       java.lang.String entryType)
                                throws CollaborationException
retrieves all the folders in the personal store of a specified principal note: this assumes there aren't too many folders in the personal store

note: retrieves only the folders, not the entries.

Parameters:
principal - owner of the personal store to query
Returns:
a Collection of PersonalStoreFolder objects
Throws:
CollaborationException

createEntry

public PersonalStoreEntry createEntry(java.lang.String entryType,
                                      java.lang.String displayName)
                               throws CollaborationException
creates a new entry This method does not necessarily commit the entry to permanent storage. The other attributes of the created entry need to be set using the methods in PersonalStoreEntry or subclass thereof. In particular, the folder(s) referencing this entry must be specified using PersonalStoreEntry.addToFolder(). After the entry is complete, it must be committed with its save() method.

Parameters:
entryType - type of entry as defined in PersonalStoreEntryType
Returns:
a new entry, which class depends on the specified type. Note that the returned entry may be a folder.
Throws:
CollaborationException

createEntry

public PersonalStoreEntry createEntry(CollaborationPrincipal principal,
                                      java.lang.String entryType,
                                      java.lang.String displayName)
                               throws CollaborationException
creates a new entry on behalf of a specified user This method does not necessarily commit the entry to permanent storage. The other attributes of the created entry need to be set using the methods in PersonalStoreEntry or subclass thereof. In particular, the folder(s) referencing this entry must be specified using PersonalStoreEntry.addToFolder(). After the entry is complete, it must be committed with its save() method.

Parameters:
principal - owner ofd the personal store in which to add the new entry
entryType - type of entry as defined in PersonalStoreEntryType
Returns:
a new entry, which class depends on the specified type. Note that the returned entry may be a folder.
Throws:
CollaborationException

searchPrincipals

public CollaborationPrincipal[] searchPrincipals(int searchType,
                                                 java.lang.String pattern)
                                          throws CollaborationException
search directory for entry This method search the corporate directory for entries that can then be used to add as a PersonalContact to the PersonalStoreFolder. There are four types of search criteria: BYUID, CONTAINNAME, STARTNAME, ENDNAME. When a particular one is choosed to be added to a folder, pass that as the argument to the createEntry() method.

Parameters:
searchType - type of search to perform
Returns:
a array of principals from the search result
Throws:
CollaborationException

searchPrincipals

public CollaborationPrincipal[] searchPrincipals(int searchType,
                                                 java.lang.String pattern,
                                                 int attribute)
                                          throws CollaborationException
search directory for entry This method search the corporate directory for entries that can then be used to add as a PersonalContact to the PersonalStoreFolder. There are four types of search criteria: BYUID, CONTAINNAME, STARTNAME, ENDNAME. When a particular one is choosed to be added to a folder, pass that as the argument to the createEntry() method. The attribute for the search can be NAME_ATTRIBUTE or UID_ATTRIBUTE or MAIL_ATTRIBUTE

Parameters:
searchType - type of search to perform
attribute - Attribute on which to search for
Returns:
a array of principals from the search result
Throws:
CollaborationException

search

public PersonalStoreEntry[] search(int searchType,
                                   java.lang.String pattern,
                                   java.lang.String entryType)
                            throws CollaborationException
search directory for entry This method search the corporate directory for entries that can then be used to add as a PersonalContact to the PersonalStoreFolder. There are four types of search criteria: BYUID, CONTAINNAME, STARTNAME, ENDNAME. When a particular one is choosed to be added to a folder, pass that as the argument to the createEntry() method.

Parameters:
searchType - type of search to perform
Returns:
a array of principals from the search result
Throws:
CollaborationException

search

public PersonalStoreEntry[] search(int searchType,
                                   java.lang.String pattern,
                                   java.lang.String entryType,
                                   int attribute)
                            throws CollaborationException
Parameters:
searchType - type of search to perform
entryType - type of the entry to search for
attribute - Attribute on which to search for
Returns:
a array of principals from the search result
Throws:
CollaborationException

getProfile

public PersonalProfile getProfile()
                           throws CollaborationException
get the profile info

Returns:
profile the profile info
Throws:
CollaborationException

getProfile

public PersonalProfile getProfile(CollaborationPrincipal principal)
                           throws CollaborationException
get the profile info

Parameters:
principal - owner of the personal store to query
Returns:
profile the profile info
Throws:
CollaborationException

save

public void save()
          throws CollaborationException
Commit unsaved personal store changes to the server

Throws:
CollaborationException

initialize

public void initialize(PersonalStoreServiceListener listener)
                throws CollaborationException
intialize the service by providing a PersonalStoreServiceListener. Service should be initialized by calling this method before using any of the services of PersonalStoreService

Throws:
CollaborationException

addPersonalStoreServiceListener

public void addPersonalStoreServiceListener(PersonalStoreServiceListener listener)
Add an additional PersonalStoreServiceListener to receive the event notifications. To receive all the initial events the first PersonalStoreServiceListener should be added while #initialize(PersonalStoreServiceListener) PersonalStoreService.


removePersonalStoreServiceListener

public void removePersonalStoreServiceListener(PersonalStoreServiceListener listener)
Removes an already added ConfereneServiceListener. To prevent loss of any event notification it is advised to have atleast one PersonalStoreServiceListener