org.sakaiproject.service.legacy.preference
Interface PreferencesService

All Superinterfaces:
EntityProducer
All Known Implementing Classes:
BasePreferencesService

public interface PreferencesService
extends EntityProducer

The PreferencesService keeps sets of preferences for each user.

Version:
$Revision: 2371 $
Author:
University of Michigan, CHEF Software Development Team

Nested Class Summary
 
Nested classes inherited from class org.sakaiproject.service.legacy.entity.EntityProducer
EntityProducer.ChangeType
 
Field Summary
static String REFERENCE_ROOT
          This string starts the references to resources in this service.
static String SECURE_ADD_PREFS
          Securiy / Event for adding a preferences.
static String SECURE_EDIT_PREFS
          Securiy / Event for updating a preferences.
static String SECURE_REMOVE_PREFS
          Securiy / Event for removing a preferences.
static String SERVICE_NAME
          This string can be used to find the service in the service manager.
 
Method Summary
 PreferencesEdit add(String id)
          Add a new set of preferences with this id.
 boolean allowUpdate(String id)
          Check to see if the current user can add or modify permissions with this id.
 void cancel(PreferencesEdit edit)
          Cancel the changes made to a PreferencesEdit object, and release the lock.
 void commit(PreferencesEdit edit)
          Commit the changes made to a PreferencesEdit object, and release the lock.
 PreferencesEdit edit(String id)
          Get a locked Preferences object for editing.
 Preferences getPreferences(String id)
          Access a set of preferences associated with this id.
 void remove(PreferencesEdit edit)
          Remove this PreferencesEdit - it must be locked from edit().
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.EntityProducer
archive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getHttpAccess, getLabel, importEntities, merge, parseEntityReference, syncWithSiteChange, willArchiveMerge, willImport
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
This string can be used to find the service in the service manager.


REFERENCE_ROOT

public static final String REFERENCE_ROOT
This string starts the references to resources in this service.

See Also:
Constant Field Values

SECURE_ADD_PREFS

public static final String SECURE_ADD_PREFS
Securiy / Event for adding a preferences.

See Also:
Constant Field Values

SECURE_EDIT_PREFS

public static final String SECURE_EDIT_PREFS
Securiy / Event for updating a preferences.

See Also:
Constant Field Values

SECURE_REMOVE_PREFS

public static final String SECURE_REMOVE_PREFS
Securiy / Event for removing a preferences.

See Also:
Constant Field Values
Method Detail

getPreferences

public Preferences getPreferences(String id)
Access a set of preferences associated with this id.

Parameters:
id - The preferences id.
Returns:
The Preferences object.

allowUpdate

public boolean allowUpdate(String id)
Check to see if the current user can add or modify permissions with this id.

Parameters:
id - The preferences id.
Returns:
true if the user is allowed to update or add these preferences, false if not.

add

public PreferencesEdit add(String id)
                    throws PermissionException,
                           IdUsedException
Add a new set of preferences with this id. Must commit(), remove() or cancel() when done.

Parameters:
id - The preferences id.
Returns:
A PreferencesEdit object for editing, possibly new.
Throws:
PermissionException - if the current user does not have permission add preferences for this id.
IdUsedException - if these preferences already exist.

edit

public PreferencesEdit edit(String id)
                     throws PermissionException,
                            InUseException,
                            IdUnusedException
Get a locked Preferences object for editing. Must commit(), cancel() or remove() when done.

Parameters:
id - The preferences id.
Returns:
A PreferencesEdit object for editing, possibly new.
Throws:
PermissionException - if the current user does not have permission to edit these preferences.
InUseException - if the preferences object is locked by someone else.
IdUnusedException - if there is not preferences object with this id.

commit

public void commit(PreferencesEdit edit)
Commit the changes made to a PreferencesEdit object, and release the lock. The PreferencesEdit is disabled, and not to be used after this call.


cancel

public void cancel(PreferencesEdit edit)
Cancel the changes made to a PreferencesEdit object, and release the lock. The PreferencesEdit is disabled, and not to be used after this call.


remove

public void remove(PreferencesEdit edit)
Remove this PreferencesEdit - it must be locked from edit(). The PreferencesEdit is disabled, and not to be used after this call.