001    /**
002     * Copyright (c) 2000-2012 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.portlet.messageboards.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the message boards category remote service. This utility wraps {@link com.liferay.portlet.messageboards.service.impl.MBCategoryServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see MBCategoryService
030     * @see com.liferay.portlet.messageboards.service.base.MBCategoryServiceBaseImpl
031     * @see com.liferay.portlet.messageboards.service.impl.MBCategoryServiceImpl
032     * @generated
033     */
034    public class MBCategoryServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBCategoryServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
041                    long parentCategoryId, java.lang.String name,
042                    java.lang.String description, java.lang.String displayStyle,
043                    java.lang.String emailAddress, java.lang.String inProtocol,
044                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
045                    java.lang.String inUserName, java.lang.String inPassword,
046                    int inReadInterval, java.lang.String outEmailAddress,
047                    boolean outCustom, java.lang.String outServerName, int outServerPort,
048                    boolean outUseSSL, java.lang.String outUserName,
049                    java.lang.String outPassword, boolean mailingListActive,
050                    boolean allowAnonymousEmail,
051                    com.liferay.portal.service.ServiceContext serviceContext)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    return getService()
055                                       .addCategory(parentCategoryId, name, description,
056                            displayStyle, emailAddress, inProtocol, inServerName, inServerPort,
057                            inUseSSL, inUserName, inPassword, inReadInterval, outEmailAddress,
058                            outCustom, outServerName, outServerPort, outUseSSL, outUserName,
059                            outPassword, mailingListActive, allowAnonymousEmail, serviceContext);
060            }
061    
062            public static void deleteCategory(long groupId, long categoryId)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    getService().deleteCategory(groupId, categoryId);
066            }
067    
068            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
069                    long groupId)
070                    throws com.liferay.portal.kernel.exception.SystemException {
071                    return getService().getCategories(groupId);
072            }
073    
074            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
075                    long groupId, long parentCategoryId, int start, int end)
076                    throws com.liferay.portal.kernel.exception.SystemException {
077                    return getService().getCategories(groupId, parentCategoryId, start, end);
078            }
079    
080            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
081                    long groupId, long[] parentCategoryIds, int start, int end)
082                    throws com.liferay.portal.kernel.exception.SystemException {
083                    return getService().getCategories(groupId, parentCategoryIds, start, end);
084            }
085    
086            public static int getCategoriesCount(long groupId, long parentCategoryId)
087                    throws com.liferay.portal.kernel.exception.SystemException {
088                    return getService().getCategoriesCount(groupId, parentCategoryId);
089            }
090    
091            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
092                    throws com.liferay.portal.kernel.exception.SystemException {
093                    return getService().getCategoriesCount(groupId, parentCategoryIds);
094            }
095    
096            public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
097                    long categoryId)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    return getService().getCategory(categoryId);
101            }
102    
103            public static long[] getCategoryIds(long groupId, long categoryId)
104                    throws com.liferay.portal.kernel.exception.SystemException {
105                    return getService().getCategoryIds(groupId, categoryId);
106            }
107    
108            public static java.util.List<java.lang.Long> getSubcategoryIds(
109                    java.util.List<java.lang.Long> categoryIds, long groupId,
110                    long categoryId)
111                    throws com.liferay.portal.kernel.exception.SystemException {
112                    return getService().getSubcategoryIds(categoryIds, groupId, categoryId);
113            }
114    
115            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getSubscribedCategories(
116                    long groupId, long userId, int start, int end)
117                    throws com.liferay.portal.kernel.exception.SystemException {
118                    return getService().getSubscribedCategories(groupId, userId, start, end);
119            }
120    
121            public static int getSubscribedCategoriesCount(long groupId, long userId)
122                    throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().getSubscribedCategoriesCount(groupId, userId);
124            }
125    
126            public static void subscribeCategory(long groupId, long categoryId)
127                    throws com.liferay.portal.kernel.exception.PortalException,
128                            com.liferay.portal.kernel.exception.SystemException {
129                    getService().subscribeCategory(groupId, categoryId);
130            }
131    
132            public static void unsubscribeCategory(long groupId, long categoryId)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    getService().unsubscribeCategory(groupId, categoryId);
136            }
137    
138            public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
139                    long categoryId, long parentCategoryId, java.lang.String name,
140                    java.lang.String description, java.lang.String displayStyle,
141                    java.lang.String emailAddress, java.lang.String inProtocol,
142                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
143                    java.lang.String inUserName, java.lang.String inPassword,
144                    int inReadInterval, java.lang.String outEmailAddress,
145                    boolean outCustom, java.lang.String outServerName, int outServerPort,
146                    boolean outUseSSL, java.lang.String outUserName,
147                    java.lang.String outPassword, boolean mailingListActive,
148                    boolean allowAnonymousEmail, boolean mergeWithParentCategory,
149                    com.liferay.portal.service.ServiceContext serviceContext)
150                    throws com.liferay.portal.kernel.exception.PortalException,
151                            com.liferay.portal.kernel.exception.SystemException {
152                    return getService()
153                                       .updateCategory(categoryId, parentCategoryId, name,
154                            description, displayStyle, emailAddress, inProtocol, inServerName,
155                            inServerPort, inUseSSL, inUserName, inPassword, inReadInterval,
156                            outEmailAddress, outCustom, outServerName, outServerPort,
157                            outUseSSL, outUserName, outPassword, mailingListActive,
158                            allowAnonymousEmail, mergeWithParentCategory, serviceContext);
159            }
160    
161            public static MBCategoryService getService() {
162                    if (_service == null) {
163                            _service = (MBCategoryService)PortalBeanLocatorUtil.locate(MBCategoryService.class.getName());
164    
165                            ReferenceRegistry.registerReference(MBCategoryServiceUtil.class,
166                                    "_service");
167                            MethodCache.remove(MBCategoryService.class);
168                    }
169    
170                    return _service;
171            }
172    
173            public void setService(MBCategoryService service) {
174                    MethodCache.remove(MBCategoryService.class);
175    
176                    _service = service;
177    
178                    ReferenceRegistry.registerReference(MBCategoryServiceUtil.class,
179                            "_service");
180                    MethodCache.remove(MBCategoryService.class);
181            }
182    
183            private static MBCategoryService _service;
184    }