001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 message remote service. This utility wraps {@link com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl} 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 MBMessageService
030     * @see com.liferay.portlet.messageboards.service.base.MBMessageServiceBaseImpl
031     * @see com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl
032     * @generated
033     */
034    public class MBMessageServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
041                    long groupId, java.lang.String className, long classPK,
042                    java.lang.String permissionClassName, long permissionClassPK,
043                    long permissionOwnerId, long threadId, long parentMessageId,
044                    java.lang.String subject, java.lang.String body,
045                    com.liferay.portal.service.ServiceContext serviceContext)
046                    throws com.liferay.portal.kernel.exception.PortalException,
047                            com.liferay.portal.kernel.exception.SystemException {
048                    return getService()
049                                       .addDiscussionMessage(groupId, className, classPK,
050                            permissionClassName, permissionClassPK, permissionOwnerId,
051                            threadId, parentMessageId, subject, body, serviceContext);
052            }
053    
054            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
055                    long groupId, long categoryId, long threadId, long parentMessageId,
056                    java.lang.String subject, java.lang.String body,
057                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
058                    boolean anonymous, double priority, boolean allowPingbacks,
059                    com.liferay.portal.service.ServiceContext serviceContext)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    return getService()
063                                       .addMessage(groupId, categoryId, threadId, parentMessageId,
064                            subject, body, files, anonymous, priority, allowPingbacks,
065                            serviceContext);
066            }
067    
068            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
069                    long groupId, long categoryId, java.lang.String subject,
070                    java.lang.String body,
071                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
072                    boolean anonymous, double priority, boolean allowPingbacks,
073                    com.liferay.portal.service.ServiceContext serviceContext)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException {
076                    return getService()
077                                       .addMessage(groupId, categoryId, subject, body, files,
078                            anonymous, priority, allowPingbacks, serviceContext);
079            }
080    
081            public static void deleteDiscussionMessage(long groupId,
082                    java.lang.String className, long classPK,
083                    java.lang.String permissionClassName, long permissionClassPK,
084                    long permissionOwnerId, long messageId)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    getService()
088                            .deleteDiscussionMessage(groupId, className, classPK,
089                            permissionClassName, permissionClassPK, permissionOwnerId, messageId);
090            }
091    
092            public static void deleteMessage(long messageId)
093                    throws com.liferay.portal.kernel.exception.PortalException,
094                            com.liferay.portal.kernel.exception.SystemException {
095                    getService().deleteMessage(messageId);
096            }
097    
098            public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
099                    long groupId, long categoryId, int status, int start, int end)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    return getService()
103                                       .getCategoryMessages(groupId, categoryId, status, start, end);
104            }
105    
106            public static int getCategoryMessagesCount(long groupId, long categoryId,
107                    int status) throws com.liferay.portal.kernel.exception.SystemException {
108                    return getService().getCategoryMessagesCount(groupId, categoryId, status);
109            }
110    
111            public static java.lang.String getCategoryMessagesRSS(long groupId,
112                    long categoryId, int status, int max, java.lang.String type,
113                    double version, java.lang.String displayStyle,
114                    java.lang.String feedURL, java.lang.String entryURL,
115                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
116                    throws com.liferay.portal.kernel.exception.PortalException,
117                            com.liferay.portal.kernel.exception.SystemException {
118                    return getService()
119                                       .getCategoryMessagesRSS(groupId, categoryId, status, max,
120                            type, version, displayStyle, feedURL, entryURL, themeDisplay);
121            }
122    
123            public static java.lang.String getCompanyMessagesRSS(long companyId,
124                    int status, int max, java.lang.String type, double version,
125                    java.lang.String displayStyle, java.lang.String feedURL,
126                    java.lang.String entryURL,
127                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
128                    throws com.liferay.portal.kernel.exception.PortalException,
129                            com.liferay.portal.kernel.exception.SystemException {
130                    return getService()
131                                       .getCompanyMessagesRSS(companyId, status, max, type,
132                            version, displayStyle, feedURL, entryURL, themeDisplay);
133            }
134    
135            public static int getGroupMessagesCount(long groupId, int status)
136                    throws com.liferay.portal.kernel.exception.SystemException {
137                    return getService().getGroupMessagesCount(groupId, status);
138            }
139    
140            public static java.lang.String getGroupMessagesRSS(long groupId,
141                    int status, int max, java.lang.String type, double version,
142                    java.lang.String displayStyle, java.lang.String feedURL,
143                    java.lang.String entryURL,
144                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
145                    throws com.liferay.portal.kernel.exception.PortalException,
146                            com.liferay.portal.kernel.exception.SystemException {
147                    return getService()
148                                       .getGroupMessagesRSS(groupId, status, max, type, version,
149                            displayStyle, feedURL, entryURL, themeDisplay);
150            }
151    
152            public static java.lang.String getGroupMessagesRSS(long groupId,
153                    long userId, int status, int max, java.lang.String type,
154                    double version, java.lang.String displayStyle,
155                    java.lang.String feedURL, java.lang.String entryURL,
156                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
157                    throws com.liferay.portal.kernel.exception.PortalException,
158                            com.liferay.portal.kernel.exception.SystemException {
159                    return getService()
160                                       .getGroupMessagesRSS(groupId, userId, status, max, type,
161                            version, displayStyle, feedURL, entryURL, themeDisplay);
162            }
163    
164            public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
165                    long messageId)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException {
168                    return getService().getMessage(messageId);
169            }
170    
171            public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
172                    long messageId, int status, java.lang.String threadView,
173                    boolean includePrevAndNext)
174                    throws com.liferay.portal.kernel.exception.PortalException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getService()
177                                       .getMessageDisplay(messageId, status, threadView,
178                            includePrevAndNext);
179            }
180    
181            public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
182                    long groupId, long categoryId, long threadId, int status, int start,
183                    int end) throws com.liferay.portal.kernel.exception.SystemException {
184                    return getService()
185                                       .getThreadMessages(groupId, categoryId, threadId, status,
186                            start, end);
187            }
188    
189            public static int getThreadMessagesCount(long groupId, long categoryId,
190                    long threadId, int status)
191                    throws com.liferay.portal.kernel.exception.SystemException {
192                    return getService()
193                                       .getThreadMessagesCount(groupId, categoryId, threadId, status);
194            }
195    
196            public static java.lang.String getThreadMessagesRSS(long threadId,
197                    int status, int max, java.lang.String type, double version,
198                    java.lang.String displayStyle, java.lang.String feedURL,
199                    java.lang.String entryURL,
200                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
201                    throws com.liferay.portal.kernel.exception.PortalException,
202                            com.liferay.portal.kernel.exception.SystemException {
203                    return getService()
204                                       .getThreadMessagesRSS(threadId, status, max, type, version,
205                            displayStyle, feedURL, entryURL, themeDisplay);
206            }
207    
208            public static void subscribeMessage(long messageId)
209                    throws com.liferay.portal.kernel.exception.PortalException,
210                            com.liferay.portal.kernel.exception.SystemException {
211                    getService().subscribeMessage(messageId);
212            }
213    
214            public static void unsubscribeMessage(long messageId)
215                    throws com.liferay.portal.kernel.exception.PortalException,
216                            com.liferay.portal.kernel.exception.SystemException {
217                    getService().unsubscribeMessage(messageId);
218            }
219    
220            public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
221                    java.lang.String className, long classPK,
222                    java.lang.String permissionClassName, long permissionClassPK,
223                    long permissionOwnerId, long messageId, java.lang.String subject,
224                    java.lang.String body,
225                    com.liferay.portal.service.ServiceContext serviceContext)
226                    throws com.liferay.portal.kernel.exception.PortalException,
227                            com.liferay.portal.kernel.exception.SystemException {
228                    return getService()
229                                       .updateDiscussionMessage(className, classPK,
230                            permissionClassName, permissionClassPK, permissionOwnerId,
231                            messageId, subject, body, serviceContext);
232            }
233    
234            public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
235                    long messageId, java.lang.String subject, java.lang.String body,
236                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
237                    java.util.List<java.lang.String> existingFiles, double priority,
238                    boolean allowPingbacks,
239                    com.liferay.portal.service.ServiceContext serviceContext)
240                    throws com.liferay.portal.kernel.exception.PortalException,
241                            com.liferay.portal.kernel.exception.SystemException {
242                    return getService()
243                                       .updateMessage(messageId, subject, body, files,
244                            existingFiles, priority, allowPingbacks, serviceContext);
245            }
246    
247            public static MBMessageService getService() {
248                    if (_service == null) {
249                            _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
250    
251                            ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
252                                    "_service");
253                            MethodCache.remove(MBMessageService.class);
254                    }
255    
256                    return _service;
257            }
258    
259            public void setService(MBMessageService service) {
260                    MethodCache.remove(MBMessageService.class);
261    
262                    _service = service;
263    
264                    ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
265                            "_service");
266                    MethodCache.remove(MBMessageService.class);
267            }
268    
269            private static MBMessageService _service;
270    }