org.sakaiproject.service.legacy.notification
Interface NotificationService

All Known Implementing Classes:
BaseNotificationService

public interface NotificationService

NotificationService is ... %%%

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

Field Summary
static int NOTI_NONE
          Notification option value for undefined or no notification.
static int NOTI_OPTIONAL
          Notification option value for optional notification.
static int NOTI_REQUIRED
          Notification option value for required notification.
static int PREF_DIGEST
          Notification preference value for digest notification.
static int PREF_IGNORE
          Notification preference value for blocking notification.
static int PREF_IMMEDIATE
          Notification preference value for immediate notification.
static int PREF_NONE
          Notification option value for undefined notification.
static String PREFS_DEFAULT
          Preferences key for default notification prefs.
static String PREFS_NOTI
          Preferences key for a specific notification - append the notification id.
static String PREFS_SITE
          Preferences key for default for a site notification prefs - append the site id.
static String PREFS_TYPE
          Preferences key for default for a resource type notification prefs - append the resource type.
static String REFERENCE_ROOT
          This string starts the references to resources in this service.
static String SECURE_ADD_NOTIFICATION
          ability / event for notification add.
static String SECURE_REMOVE_NOTIFICATION
          ability / event for notification removal.
static String SECURE_UPDATE_NOTIFICATION
          ability / event for notification update.
static String SERVICE_NAME
          This string can be used to find the service in the service manager.
 
Method Summary
 NotificationEdit addNotification()
          Establish a new notification, locked for edit.
 NotificationEdit addTransientNotification()
          Establish a new transient notification.
 void cancelEdit(NotificationEdit notification)
          Cancel the changes made to a NotificationEdit object, and release the lock.
 void commitEdit(NotificationEdit notification)
          Commit the changes made to a NotificationEdit object, and release the lock.
 NotificationEdit editNotification(String id)
          Get a locked notification object for editing.
 Notification findNotification(String function, String filter)
          Find a notification object.
 Notification getNotification(String id)
          Access a notification object.
 String notificationReference(String id)
          Access the internal reference which can be used to access the resource from within the system.
 void removeNotification(NotificationEdit notification)
          Remove this notification - it must be a notification with a lock from editNotification().
 

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_NOTIFICATION

public static final String SECURE_ADD_NOTIFICATION
ability / event for notification add.

See Also:
Constant Field Values

SECURE_UPDATE_NOTIFICATION

public static final String SECURE_UPDATE_NOTIFICATION
ability / event for notification update.

See Also:
Constant Field Values

SECURE_REMOVE_NOTIFICATION

public static final String SECURE_REMOVE_NOTIFICATION
ability / event for notification removal.

See Also:
Constant Field Values

NOTI_NONE

public static final int NOTI_NONE
Notification option value for undefined or no notification.

See Also:
Constant Field Values

NOTI_REQUIRED

public static final int NOTI_REQUIRED
Notification option value for required notification.

See Also:
Constant Field Values

NOTI_OPTIONAL

public static final int NOTI_OPTIONAL
Notification option value for optional notification.

See Also:
Constant Field Values

PREF_NONE

public static final int PREF_NONE
Notification option value for undefined notification.

See Also:
Constant Field Values

PREF_IGNORE

public static final int PREF_IGNORE
Notification preference value for blocking notification.

See Also:
Constant Field Values

PREF_DIGEST

public static final int PREF_DIGEST
Notification preference value for digest notification.

See Also:
Constant Field Values

PREF_IMMEDIATE

public static final int PREF_IMMEDIATE
Notification preference value for immediate notification.

See Also:
Constant Field Values

PREFS_DEFAULT

public static final String PREFS_DEFAULT
Preferences key for default notification prefs.

See Also:
Constant Field Values

PREFS_TYPE

public static final String PREFS_TYPE
Preferences key for default for a resource type notification prefs - append the resource type.

See Also:
Constant Field Values

PREFS_SITE

public static final String PREFS_SITE
Preferences key for default for a site notification prefs - append the site id.

See Also:
Constant Field Values

PREFS_NOTI

public static final String PREFS_NOTI
Preferences key for a specific notification - append the notification id.

See Also:
Constant Field Values
Method Detail

addNotification

public NotificationEdit addNotification()
Establish a new notification, locked for edit. Must commitEdit() to make official, or cancelEdit() when done!

Returns:
a new Notification, locked for edit.

addTransientNotification

public NotificationEdit addTransientNotification()
Establish a new transient notification. Transient notifications are processed by the service but not stored in storage. Modification to the notification can be done at any time, do not use edit(), commit() or remove() on it.

Returns:
a new transient Notification.

getNotification

public Notification getNotification(String id)
                             throws IdUnusedException
Access a notification object.

Parameters:
id - The notification id string.
Returns:
A notification object containing the notification information.
Throws:
IdUnusedException - if not found.

editNotification

public NotificationEdit editNotification(String id)
                                  throws IdUnusedException,
                                         InUseException
Get a locked notification object for editing. Must commitEdit() to make official, or cancelEdit() when done!

Parameters:
id - The notification id string.
Returns:
A NotificationEdit object for editing.
Throws:
IdUnusedException - if not found.
PermissionException - if the current notification does not have permission to mess with this notification.
InUseException - if the current notification does not have permission to mess with this notification.

commitEdit

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

Parameters:
notification - The NotificationEdit object to commit.

cancelEdit

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

Parameters:
notification - The NotificationEdit object to commit.

removeNotification

public void removeNotification(NotificationEdit notification)
Remove this notification - it must be a notification with a lock from editNotification(). The NotificationEdit is disabled, and not to be used after this call.

Throws:
PermissionException - if the current notification does not have permission to remove this notification.

notificationReference

public String notificationReference(String id)
Access the internal reference which can be used to access the resource from within the system.

Parameters:
id - The notification id.
Returns:
The the internal reference which can be used to access the resource from within the system.

findNotification

public Notification findNotification(String function,
                                     String filter)
Find a notification object.

Parameters:
function - The function setting of the notification object.
filter - The resourceFilter setting of the notification object.
Returns:
A notification object matching the criteria, or null if none found.