org.sakaiproject.component.legacy.notification
Class BaseNotificationService.BaseNotification

java.lang.Object
  extended byorg.sakaiproject.component.legacy.notification.BaseNotificationService.BaseNotification
All Implemented Interfaces:
Entity, Notification
Direct Known Subclasses:
BaseNotificationService.BaseNotificationEdit
Enclosing class:
BaseNotificationService

public class BaseNotificationService.BaseNotification
extends Object
implements Notification

Notification implementation


Field Summary
protected  NotificationAction m_action
          The action helper class.
protected  String m_filter
          The resource reference filter.
protected  List m_functions
          The Event(s) function we are watching for.
protected  String m_id
          The resource id.
protected  ResourcePropertiesEdit m_properties
          The resource properties.
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
BaseNotificationService.BaseNotification(Element el)
          Construct from an existing definition, in xml.
BaseNotificationService.BaseNotification(Notification other)
          Construct from another Notification.
BaseNotificationService.BaseNotification(String id)
          Construct.
 
Method Summary
 boolean containsFunction(String function)
          Check if the notification watches for events with this function code.
 NotificationAction getAction()
          Get the action helper that handles the notify() action.
 String getFunction()
          Get the Event function.
 List getFunctions()
          Get all the Event functions for this notification.
 String getId()
          Access the id of the resource.
 ResourceProperties getProperties()
          Access the resource's properties.
 String getReference()
          Access the internal reference which can be used to access the resource from within the system.
 String getReference(String rootProperty)
          Access the alternate internal reference which can be used to access the entity from within the system.
 String getResourceFilter()
          Get the resource reference filter.
 String getUrl()
          Access the URL which can be used to access the resource.
 String getUrl(String rootProperty)
          Access the alternate URL which can be used to access the entity.
 void notify(Event event)
          Do the notification.
protected  void setAll(Notification other)
          Take all values from this object.
 Element toXml(Document doc, Stack stack)
          Serialize the resource into XML, adding an element to the doc under the top of the stack element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_functions

protected List m_functions
The Event(s) function we are watching for.


m_filter

protected String m_filter
The resource reference filter.


m_id

protected String m_id
The resource id.


m_properties

protected ResourcePropertiesEdit m_properties
The resource properties.


m_action

protected NotificationAction m_action
The action helper class.

Constructor Detail

BaseNotificationService.BaseNotification

public BaseNotificationService.BaseNotification(String id)
Construct.

Parameters:
id - The id to use.

BaseNotificationService.BaseNotification

public BaseNotificationService.BaseNotification(Notification other)
Construct from another Notification.


BaseNotificationService.BaseNotification

public BaseNotificationService.BaseNotification(Element el)
Construct from an existing definition, in xml.

Parameters:
el - The message in XML in a DOM element.
Method Detail

setAll

protected void setAll(Notification other)
Take all values from this object.

Parameters:
other - The notification object to take values from.

notify

public void notify(Event event)
Do the notification.

Specified by:
notify in interface Notification
Parameters:
event - The event that matched criteria to cause the notification.

getFunction

public String getFunction()
Get the Event function. Only Events with this function code will trigger the notification.

Specified by:
getFunction in interface Notification
Returns:
The Event function to watch for.

getResourceFilter

public String getResourceFilter()
Get the resource reference filter. Only Events with references matching this will trigger the notification.

Specified by:
getResourceFilter in interface Notification
Returns:
The resource reference filter.

getFunctions

public List getFunctions()
Get all the Event functions for this notification.

Specified by:
getFunctions in interface Notification
Returns:
a List (String) of Event functions to watch for.

containsFunction

public boolean containsFunction(String function)
Check if the notification watches for events with this function code.

Specified by:
containsFunction in interface Notification
Returns:
true if this notification watches for evens with this function code, false if not.

getAction

public NotificationAction getAction()
Get the action helper that handles the notify() action.

Specified by:
getAction in interface Notification
Returns:
The action helper that handles the notify() action.

getUrl

public String getUrl()
Access the URL which can be used to access the resource.

Specified by:
getUrl in interface Entity
Returns:
The URL which can be used to access the resource.

getReference

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

Specified by:
getReference in interface Entity
Returns:
The the internal reference which can be used to access the resource from within the system.

getReference

public String getReference(String rootProperty)
Description copied from interface: Entity
Access the alternate internal reference which can be used to access the entity from within the system.

Specified by:
getReference in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference is requested. If null, the native 'raw' reference is requested.
Returns:
The the alternate internal reference which can be used to access the entity from within the system.

getUrl

public String getUrl(String rootProperty)
Description copied from interface: Entity
Access the alternate URL which can be used to access the entity.

Specified by:
getUrl in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference URL is requested. If null, the native 'raw' URL is requested.
Returns:
The alternate URL which can be used to access the entity.

getId

public String getId()
Access the id of the resource.

Specified by:
getId in interface Entity
Returns:
The id.

getProperties

public ResourceProperties getProperties()
Access the resource's properties.

Specified by:
getProperties in interface Entity
Returns:
The resource's properties.

toXml

public Element toXml(Document doc,
                     Stack stack)
Serialize the resource into XML, adding an element to the doc under the top of the stack element.

Specified by:
toXml in interface Entity
Parameters:
doc - The DOM doc to contain the XML (or null for a string return).
stack - The DOM elements, the top of which is the containing element of the new "resource" element.
Returns:
The newly added element.