com.sun.im.service
Interface PersonalStoreSession

All Superinterfaces:
CollaborationSession

public interface PersonalStoreSession
extends CollaborationSession


Field Summary
static int SEARCH_BAD_ARGUMENT
           
static int SEARCH_DISABLED
           
static int SEARCH_ERROR
           
static int SEARCH_LIMIT_EXCEEDED
           
static int SEARCH_OK
           
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
 
Method Summary
 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 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.
 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.
 
Methods inherited from interface com.sun.im.service.CollaborationSession
accessService, addPrivacyList, addSessionListener, changePassword, createPrincipal, createPrincipal, createPrivacyList, getActivePrivacyListName, getConferenceService, getDefaultPrivacyListName, getNewsService, getNotificationService, getPersonalStoreService, getPresenceService, getPrincipal, getPrivacyList, getStreamingService, listPrivacyLists, logout, removePrivacyList, removeSessionListener, setActivePrivacyListName, setDefaultPrivacyListName, setSessionListener, unregister
 

Field Detail

SEARCH_LIMIT_EXCEEDED

public static final int SEARCH_LIMIT_EXCEEDED
See Also:
Constant Field Values

SEARCH_OK

public static final int SEARCH_OK
See Also:
Constant Field Values

SEARCH_BAD_ARGUMENT

public static final int SEARCH_BAD_ARGUMENT
See Also:
Constant Field Values

SEARCH_DISABLED

public static final int SEARCH_DISABLED
See Also:
Constant Field Values

SEARCH_ERROR

public static final int SEARCH_ERROR
See Also:
Constant Field Values

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
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

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

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(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

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

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