001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.mail.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.exception.SystemException;
019    
020    /**
021     * @author Alexander Chow
022     */
023    public class CyrusServiceUtil {
024    
025            public static void addUser(
026                            long userId, String emailAddress, String password)
027                    throws SystemException {
028    
029                    getService().addUser(userId, emailAddress, password);
030            }
031    
032            public static CyrusService getService() {
033                    if (_service == null) {
034                            _service = (CyrusService)PortalBeanLocatorUtil.locate(
035                                    CyrusService.class.getName());
036                    }
037    
038                    return _service;
039            }
040    
041            public static void deleteEmailAddress(long companyId, long userId)
042                    throws SystemException {
043    
044                    getService().deleteEmailAddress(companyId, userId);
045            }
046    
047            public static void deleteUser(long userId) throws SystemException {
048                    getService().deleteUser(userId);
049            }
050    
051            public static void updateEmailAddress(
052                            long companyId, long userId, String emailAddress)
053                    throws SystemException {
054    
055                    getService().updateEmailAddress(companyId, userId, emailAddress);
056            }
057    
058            public static void updatePassword(
059                            long companyId, long userId, String password)
060                    throws SystemException {
061    
062                    getService().updatePassword(companyId, userId, password);
063            }
064    
065            public void setService(CyrusService service) {
066                    _service = service;
067            }
068    
069            private static CyrusService _service;
070    
071    }