01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/event/tags/sakai_2-4-1/event-api/api/src/java/org/sakaiproject/event/api/Notification.java $
03: * $Id: Notification.java 7072 2006-03-27 20:55:20Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.event.api;
21:
22: import java.util.List;
23:
24: import org.sakaiproject.entity.api.Entity;
25:
26: /**
27: * <p>
28: * Notification the interface for classes that act to notify, used with the GenericNotificationService.
29: * </p>
30: */
31: public interface Notification extends Entity {
32: /**
33: * Do the notification.
34: *
35: * @param event
36: * The event that matched criteria to cause the notification.
37: */
38: void notify(Event event);
39:
40: /**
41: * Get the Event function. Only Events with this function code will trigger the notification.
42: *
43: * @return The Event function to watch for.
44: */
45: String getFunction();
46:
47: /**
48: * Get all the Event functions for this notification.
49: *
50: * @return a List (String) of Event functions to watch for.
51: */
52: List getFunctions();
53:
54: /**
55: * Check if the notification watches for events with this function code.
56: *
57: * @param event
58: * The Event function to test.
59: * @return true if this notification watches for evens with this function code, false if not.
60: */
61: boolean containsFunction(String function);
62:
63: /**
64: * Get the resource reference filter. Only Events with references matching this will trigger the notification.
65: *
66: * @return The resource reference filter.
67: */
68: String getResourceFilter();
69:
70: /**
71: * Get the action helper that handles the notify() action.
72: *
73: * @return The action helper that handles the notify() action.
74: */
75: NotificationAction getAction();
76: }
|