01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/courier/tags/sakai_2-4-1/courier-api/api/src/java/org/sakaiproject/courier/cover/CourierService.java $
03: * $Id: CourierService.java 6940 2006-03-23 16:35:31Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 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.courier.cover;
21:
22: import org.sakaiproject.component.cover.ComponentManager;
23:
24: /**
25: * <p>CourierService is a static Cover for the {@link org.sakaiproject.courier.api.CourierService CourierService};
26: * see that interface for usage details.</p>
27: */
28: public class CourierService {
29: /**
30: * Access the component instance: special cover only method.
31: * @return the component instance.
32: */
33: public static org.sakaiproject.courier.api.CourierService getInstance() {
34: if (ComponentManager.CACHE_COMPONENTS) {
35: if (m_instance == null)
36: m_instance = (org.sakaiproject.courier.api.CourierService) ComponentManager
37: .get(org.sakaiproject.courier.api.CourierService.class);
38: return m_instance;
39: } else {
40: return (org.sakaiproject.courier.api.CourierService) ComponentManager
41: .get(org.sakaiproject.courier.api.CourierService.class);
42: }
43: }
44:
45: private static org.sakaiproject.courier.api.CourierService m_instance = null;
46:
47: public static java.lang.String SERVICE_NAME = org.sakaiproject.courier.api.CourierService.SERVICE_NAME;
48:
49: public static void deliver(
50: org.sakaiproject.courier.api.Delivery param0) {
51: org.sakaiproject.courier.api.CourierService service = getInstance();
52: if (service == null)
53: return;
54:
55: service.deliver(param0);
56: }
57:
58: public static java.util.List getDeliveries(java.lang.String param0) {
59: org.sakaiproject.courier.api.CourierService service = getInstance();
60: if (service == null)
61: return null;
62:
63: return service.getDeliveries(param0);
64: }
65:
66: public static boolean hasDeliveries(java.lang.String param0) {
67: org.sakaiproject.courier.api.CourierService service = getInstance();
68: if (service == null)
69: return false;
70:
71: return service.hasDeliveries(param0);
72: }
73:
74: public static void clear(java.lang.String param0,
75: java.lang.String param1) {
76: org.sakaiproject.courier.api.CourierService service = getInstance();
77: if (service == null)
78: return;
79:
80: service.clear(param0, param1);
81: }
82:
83: public static void clear(java.lang.String param0) {
84: org.sakaiproject.courier.api.CourierService service = getInstance();
85: if (service == null)
86: return;
87:
88: service.clear(param0);
89: }
90: }
|