001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/event/tags/sakai_2-4-1/event-api/api/src/java/org/sakaiproject/event/cover/NotificationService.java $
003: * $Id: NotificationService.java 13804 2006-08-17 02:47:37Z ggolden@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.event.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * NotificationService is a static Cover for the {@link org.sakaiproject.event.api.NotificationService NotificationService}; see that interface for usage details.
027: * </p>
028: */
029: public class NotificationService {
030: /**
031: * Access the component instance: special cover only method.
032: *
033: * @return the component instance.
034: */
035: public static org.sakaiproject.event.api.NotificationService getInstance() {
036: if (ComponentManager.CACHE_COMPONENTS) {
037: if (m_instance == null)
038: m_instance = (org.sakaiproject.event.api.NotificationService) ComponentManager
039: .get(org.sakaiproject.event.api.NotificationService.class);
040: return m_instance;
041: } else {
042: return (org.sakaiproject.event.api.NotificationService) ComponentManager
043: .get(org.sakaiproject.event.api.NotificationService.class);
044: }
045: }
046:
047: private static org.sakaiproject.event.api.NotificationService m_instance = null;
048:
049: public static java.lang.String SERVICE_NAME = org.sakaiproject.event.api.NotificationService.SERVICE_NAME;
050:
051: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.event.api.NotificationService.REFERENCE_ROOT;
052:
053: public static java.lang.String SECURE_ADD_NOTIFICATION = org.sakaiproject.event.api.NotificationService.SECURE_ADD_NOTIFICATION;
054:
055: public static java.lang.String SECURE_UPDATE_NOTIFICATION = org.sakaiproject.event.api.NotificationService.SECURE_UPDATE_NOTIFICATION;
056:
057: public static java.lang.String SECURE_REMOVE_NOTIFICATION = org.sakaiproject.event.api.NotificationService.SECURE_REMOVE_NOTIFICATION;
058:
059: public static int NOTI_NONE = org.sakaiproject.event.api.NotificationService.NOTI_NONE;
060:
061: public static int NOTI_REQUIRED = org.sakaiproject.event.api.NotificationService.NOTI_REQUIRED;
062:
063: public static int NOTI_OPTIONAL = org.sakaiproject.event.api.NotificationService.NOTI_OPTIONAL;
064:
065: public static int PREF_NONE = org.sakaiproject.event.api.NotificationService.PREF_NONE;
066:
067: public static int PREF_IGNORE = org.sakaiproject.event.api.NotificationService.PREF_IGNORE;
068:
069: public static int PREF_DIGEST = org.sakaiproject.event.api.NotificationService.PREF_DIGEST;
070:
071: public static int PREF_IMMEDIATE = org.sakaiproject.event.api.NotificationService.PREF_IMMEDIATE;
072:
073: public static java.lang.String PREFS_DEFAULT = org.sakaiproject.event.api.NotificationService.PREFS_DEFAULT;
074:
075: public static java.lang.String PREFS_TYPE = org.sakaiproject.event.api.NotificationService.PREFS_TYPE;
076:
077: public static java.lang.String PREFS_SITE = org.sakaiproject.event.api.NotificationService.PREFS_SITE;
078:
079: public static java.lang.String PREFS_NOTI = org.sakaiproject.event.api.NotificationService.PREFS_NOTI;
080:
081: public static void commitEdit(
082: org.sakaiproject.event.api.NotificationEdit param0) {
083: org.sakaiproject.event.api.NotificationService service = getInstance();
084: if (service == null)
085: return;
086:
087: service.commitEdit(param0);
088: }
089:
090: public static void cancelEdit(
091: org.sakaiproject.event.api.NotificationEdit param0) {
092: org.sakaiproject.event.api.NotificationService service = getInstance();
093: if (service == null)
094: return;
095:
096: service.cancelEdit(param0);
097: }
098:
099: public static org.sakaiproject.event.api.NotificationEdit addNotification() {
100: org.sakaiproject.event.api.NotificationService service = getInstance();
101: if (service == null)
102: return null;
103:
104: return service.addNotification();
105: }
106:
107: public static org.sakaiproject.event.api.NotificationEdit addTransientNotification() {
108: org.sakaiproject.event.api.NotificationService service = getInstance();
109: if (service == null)
110: return null;
111:
112: return service.addTransientNotification();
113: }
114:
115: public static org.sakaiproject.event.api.Notification getNotification(
116: java.lang.String param0)
117: throws org.sakaiproject.event.api.NotificationNotDefinedException {
118: org.sakaiproject.event.api.NotificationService service = getInstance();
119: if (service == null)
120: return null;
121:
122: return service.getNotification(param0);
123: }
124:
125: public static org.sakaiproject.event.api.NotificationEdit editNotification(
126: java.lang.String param0)
127: throws org.sakaiproject.event.api.NotificationNotDefinedException,
128: org.sakaiproject.event.api.NotificationLockedException {
129: org.sakaiproject.event.api.NotificationService service = getInstance();
130: if (service == null)
131: return null;
132:
133: return service.editNotification(param0);
134: }
135:
136: public static void removeNotification(
137: org.sakaiproject.event.api.NotificationEdit param0) {
138: org.sakaiproject.event.api.NotificationService service = getInstance();
139: if (service == null)
140: return;
141:
142: service.removeNotification(param0);
143: }
144:
145: public static java.lang.String notificationReference(
146: java.lang.String param0) {
147: org.sakaiproject.event.api.NotificationService service = getInstance();
148: if (service == null)
149: return null;
150:
151: return service.notificationReference(param0);
152: }
153:
154: public static org.sakaiproject.event.api.Notification findNotification(
155: java.lang.String param0, java.lang.String param1) {
156: org.sakaiproject.event.api.NotificationService service = getInstance();
157: if (service == null)
158: return null;
159:
160: return service.findNotification(param0, param1);
161: }
162:
163: public static boolean isNotificationToReplyable() {
164: org.sakaiproject.event.api.NotificationService service = getInstance();
165: if (service == null)
166: return false;
167:
168: return service.isNotificationToReplyable();
169: }
170:
171: public static boolean isNotificationFromReplyable() {
172: org.sakaiproject.event.api.NotificationService service = getInstance();
173: if (service == null)
174: return false;
175:
176: return service.isNotificationFromReplyable();
177: }
178: }
|