01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/email/tags/sakai_2-4-1/email-api/api/src/java/org/sakaiproject/email/cover/EmailService.java $
03: * $Id: EmailService.java 13805 2006-08-17 02:47:52Z 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.email.cover;
21:
22: import org.sakaiproject.component.cover.ComponentManager;
23:
24: /**
25: * <p>
26: * EmailService is a static Cover for the {@link org.sakaiproject.email.api.EmailService EmailService}; see that interface for usage details.
27: * </p>
28: */
29: public class EmailService {
30: /**
31: * Access the component instance: special cover only method.
32: *
33: * @return the component instance.
34: */
35: public static org.sakaiproject.email.api.EmailService getInstance() {
36: if (ComponentManager.CACHE_COMPONENTS) {
37: if (m_instance == null)
38: m_instance = (org.sakaiproject.email.api.EmailService) ComponentManager
39: .get(org.sakaiproject.email.api.EmailService.class);
40: return m_instance;
41: } else {
42: return (org.sakaiproject.email.api.EmailService) ComponentManager
43: .get(org.sakaiproject.email.api.EmailService.class);
44: }
45: }
46:
47: private static org.sakaiproject.email.api.EmailService m_instance = null;
48:
49: public static void sendMail(
50: javax.mail.internet.InternetAddress param0,
51: javax.mail.internet.InternetAddress[] param1,
52: java.lang.String param2, java.lang.String param3,
53: javax.mail.internet.InternetAddress[] param4,
54: javax.mail.internet.InternetAddress[] param5,
55: java.util.List param6) {
56: org.sakaiproject.email.api.EmailService service = getInstance();
57: if (service == null)
58: return;
59:
60: service.sendMail(param0, param1, param2, param3, param4,
61: param5, param6);
62: }
63:
64: public static void send(java.lang.String param0,
65: java.lang.String param1, java.lang.String param2,
66: java.lang.String param3, java.lang.String param4,
67: java.lang.String param5, java.util.List param6) {
68: org.sakaiproject.email.api.EmailService service = getInstance();
69: if (service == null)
70: return;
71:
72: service.send(param0, param1, param2, param3, param4, param5,
73: param6);
74: }
75:
76: public static void sendToUsers(java.util.Collection users,
77: java.util.Collection headers, java.lang.String message) {
78: org.sakaiproject.email.api.EmailService service = getInstance();
79: if (service == null)
80: return;
81:
82: service.sendToUsers(users, headers, message);
83: }
84: }
|