1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.mail.service;
24  
25  import com.liferay.mail.model.Filter;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.mail.MailMessage;
28  
29  import java.util.List;
30  
31  import javax.mail.Session;
32  
33  /**
34   * <a href="MailServiceUtil.java.html"><b><i>View Source</i></b></a>
35   *
36   * @author Brian Wing Shun Chan
37   */
38  public class MailServiceUtil {
39  
40      public static void addForward(
41          long companyId, long userId, List<Filter> filters,
42          List<String> emailAddresses, boolean leaveCopy) {
43  
44          _service.addForward(
45              companyId, userId, filters, emailAddresses, leaveCopy);
46      }
47  
48      public static void addUser(
49          long companyId, long userId, String password, String firstName,
50          String middleName, String lastName, String emailAddress) {
51  
52          _service.addUser(
53              companyId, userId, password, firstName, middleName, lastName,
54              emailAddress);
55      }
56  
57      public static void addVacationMessage(
58          long companyId, long userId, String emailAddress,
59          String vacationMessage) {
60  
61          _service.addVacationMessage(
62              companyId, userId, emailAddress, vacationMessage);
63      }
64  
65      public static void clearSession() {
66          _service.clearSession();
67      }
68  
69      public static void deleteEmailAddress(long companyId, long userId) {
70          _service.deleteEmailAddress(companyId, userId);
71      }
72  
73      public static void deleteUser(long companyId, long userId) {
74          _service.deleteUser(companyId, userId);
75      }
76  
77      public static Session getSession() throws SystemException {
78          return _service.getSession();
79      }
80  
81      public static void sendEmail(MailMessage mailMessage) {
82          _service.sendEmail(mailMessage);
83      }
84  
85      public static void updateBlocked(
86          long companyId, long userId, List<String> blocked) {
87  
88          _service.updateBlocked(companyId, userId, blocked);
89      }
90  
91      public static void updateEmailAddress(
92          long companyId, long userId, String emailAddress) {
93  
94          _service.updateEmailAddress(companyId, userId, emailAddress);
95      }
96  
97      public static void updatePassword(
98          long companyId, long userId, String password) {
99  
100         _service.updatePassword(companyId, userId, password);
101     }
102 
103     public void setService(MailService service) {
104         _service = service;
105     }
106 
107     private static MailService _service;
108 
109 }