001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.mail.service;
022:
023: import com.liferay.portal.SystemException;
024: import com.liferay.portal.kernel.mail.MailMessage;
025:
026: import java.rmi.RemoteException;
027:
028: import java.util.List;
029:
030: /**
031: * <a href="MailServiceUtil.java.html"><b><i>View Source</i></b></a>
032: *
033: * @author Brian Wing Shun Chan
034: *
035: */
036: public class MailServiceUtil {
037:
038: public static void addForward(long userId, List filters,
039: List emailAddresses, boolean leaveCopy)
040: throws RemoteException, SystemException {
041:
042: MailService mailService = MailServiceFactory.getService();
043:
044: mailService.addForward(userId, filters, emailAddresses,
045: leaveCopy);
046: }
047:
048: public static void addUser(long userId, String password,
049: String firstName, String middleName, String lastName,
050: String emailAddress) throws RemoteException,
051: SystemException {
052:
053: MailService mailService = MailServiceFactory.getService();
054:
055: mailService.addUser(userId, password, firstName, middleName,
056: lastName, emailAddress);
057: }
058:
059: public static void addVacationMessage(long userId,
060: String emailAddress, String vacationMessage)
061: throws RemoteException, SystemException {
062:
063: MailService mailService = MailServiceFactory.getService();
064:
065: mailService.addVacationMessage(userId, emailAddress,
066: vacationMessage);
067: }
068:
069: public static void deleteEmailAddress(long userId)
070: throws RemoteException, SystemException {
071:
072: MailService mailService = MailServiceFactory.getService();
073:
074: mailService.deleteEmailAddress(userId);
075: }
076:
077: public static void deleteUser(long userId) throws RemoteException,
078: SystemException {
079:
080: MailService mailService = MailServiceFactory.getService();
081:
082: mailService.deleteUser(userId);
083: }
084:
085: public static void sendEmail(MailMessage mailMessage)
086: throws RemoteException, SystemException {
087:
088: MailService mailService = MailServiceFactory.getService();
089:
090: mailService.sendEmail(mailMessage);
091: }
092:
093: public static void updateBlocked(long userId, List blocked)
094: throws RemoteException, SystemException {
095:
096: MailService mailService = MailServiceFactory.getService();
097:
098: mailService.updateBlocked(userId, blocked);
099: }
100:
101: public static void updateEmailAddress(long userId,
102: String emailAddress) throws RemoteException,
103: SystemException {
104:
105: MailService mailService = MailServiceFactory.getService();
106:
107: mailService.updateEmailAddress(userId, emailAddress);
108: }
109:
110: public static void updatePassword(long userId, String password)
111: throws RemoteException, SystemException {
112:
113: MailService mailService = MailServiceFactory.getService();
114:
115: mailService.updatePassword(userId, password);
116: }
117:
118: }
|