001    /**
002     * Copyright (c) 2000-present 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.message.boards.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the remote service utility for MBMessage. This utility wraps
024     * {@link com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on a remote server. Methods of this service are expected to have security
027     * checks based on the propagated JAAS credentials because this service can be
028     * accessed remotely.
029     *
030     * @author Brian Wing Shun Chan
031     * @see MBMessageService
032     * @see com.liferay.portlet.messageboards.service.base.MBMessageServiceBaseImpl
033     * @see com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class MBMessageServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * 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.
042             */
043            public static com.liferay.message.boards.kernel.model.MBMessage addDiscussionMessage(
044                    long groupId, java.lang.String className, long classPK, long threadId,
045                    long parentMessageId, java.lang.String subject, java.lang.String body,
046                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
047                    throws com.liferay.portal.kernel.exception.PortalException {
048                    return getService()
049                                       .addDiscussionMessage(groupId, className, classPK, threadId,
050                            parentMessageId, subject, body, serviceContext);
051            }
052    
053            public static com.liferay.message.boards.kernel.model.MBMessage addMessage(
054                    long categoryId, java.lang.String subject, java.lang.String body,
055                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
056                    throws com.liferay.portal.kernel.exception.PortalException {
057                    return getService().addMessage(categoryId, subject, body, serviceContext);
058            }
059    
060            public static com.liferay.message.boards.kernel.model.MBMessage addMessage(
061                    long groupId, long categoryId, java.lang.String subject,
062                    java.lang.String body, java.lang.String format,
063                    java.lang.String fileName, java.io.File file, boolean anonymous,
064                    double priority, boolean allowPingbacks,
065                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
066                    throws com.liferay.portal.kernel.exception.PortalException,
067                            java.io.FileNotFoundException {
068                    return getService()
069                                       .addMessage(groupId, categoryId, subject, body, format,
070                            fileName, file, anonymous, priority, allowPingbacks, serviceContext);
071            }
072    
073            public static com.liferay.message.boards.kernel.model.MBMessage addMessage(
074                    long groupId, long categoryId, java.lang.String subject,
075                    java.lang.String body, java.lang.String format,
076                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
077                    boolean anonymous, double priority, boolean allowPingbacks,
078                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
079                    throws com.liferay.portal.kernel.exception.PortalException {
080                    return getService()
081                                       .addMessage(groupId, categoryId, subject, body, format,
082                            inputStreamOVPs, anonymous, priority, allowPingbacks, serviceContext);
083            }
084    
085            public static com.liferay.message.boards.kernel.model.MBMessage addMessage(
086                    long parentMessageId, java.lang.String subject, java.lang.String body,
087                    java.lang.String format,
088                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
089                    boolean anonymous, double priority, boolean allowPingbacks,
090                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
091                    throws com.liferay.portal.kernel.exception.PortalException {
092                    return getService()
093                                       .addMessage(parentMessageId, subject, body, format,
094                            inputStreamOVPs, anonymous, priority, allowPingbacks, serviceContext);
095            }
096    
097            public static com.liferay.message.boards.kernel.model.MBMessage getMessage(
098                    long messageId)
099                    throws com.liferay.portal.kernel.exception.PortalException {
100                    return getService().getMessage(messageId);
101            }
102    
103            public static com.liferay.message.boards.kernel.model.MBMessage updateDiscussionMessage(
104                    java.lang.String className, long classPK, long messageId,
105                    java.lang.String subject, java.lang.String body,
106                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
107                    throws com.liferay.portal.kernel.exception.PortalException {
108                    return getService()
109                                       .updateDiscussionMessage(className, classPK, messageId,
110                            subject, body, serviceContext);
111            }
112    
113            public static com.liferay.message.boards.kernel.model.MBMessage updateMessage(
114                    long messageId, java.lang.String subject, java.lang.String body,
115                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
116                    java.util.List<java.lang.String> existingFiles, double priority,
117                    boolean allowPingbacks,
118                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
119                    throws com.liferay.portal.kernel.exception.PortalException {
120                    return getService()
121                                       .updateMessage(messageId, subject, body, inputStreamOVPs,
122                            existingFiles, priority, allowPingbacks, serviceContext);
123            }
124    
125            public static com.liferay.message.boards.kernel.model.MBMessageDisplay getMessageDisplay(
126                    long messageId, int status)
127                    throws com.liferay.portal.kernel.exception.PortalException {
128                    return getService().getMessageDisplay(messageId, status);
129            }
130    
131            /**
132            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
133            int)}
134            */
135            @Deprecated
136            public static com.liferay.message.boards.kernel.model.MBMessageDisplay getMessageDisplay(
137                    long messageId, int status, java.lang.String threadView,
138                    boolean includePrevAndNext)
139                    throws com.liferay.portal.kernel.exception.PortalException {
140                    return getService()
141                                       .getMessageDisplay(messageId, status, threadView,
142                            includePrevAndNext);
143            }
144    
145            public static int getCategoryMessagesCount(long groupId, long categoryId,
146                    int status) {
147                    return getService().getCategoryMessagesCount(groupId, categoryId, status);
148            }
149    
150            public static int getGroupMessagesCount(long groupId, int status) {
151                    return getService().getGroupMessagesCount(groupId, status);
152            }
153    
154            public static int getThreadAnswersCount(long groupId, long categoryId,
155                    long threadId) {
156                    return getService().getThreadAnswersCount(groupId, categoryId, threadId);
157            }
158    
159            public static int getThreadMessagesCount(long groupId, long categoryId,
160                    long threadId, int status) {
161                    return getService()
162                                       .getThreadMessagesCount(groupId, categoryId, threadId, status);
163            }
164    
165            public static java.lang.String getCategoryMessagesRSS(long groupId,
166                    long categoryId, int status, int max, java.lang.String type,
167                    double version, java.lang.String displayStyle,
168                    java.lang.String feedURL, java.lang.String entryURL,
169                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
170                    throws com.liferay.portal.kernel.exception.PortalException {
171                    return getService()
172                                       .getCategoryMessagesRSS(groupId, categoryId, status, max,
173                            type, version, displayStyle, feedURL, entryURL, themeDisplay);
174            }
175    
176            public static java.lang.String getCompanyMessagesRSS(long companyId,
177                    int status, int max, java.lang.String type, double version,
178                    java.lang.String displayStyle, java.lang.String feedURL,
179                    java.lang.String entryURL,
180                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
181                    throws com.liferay.portal.kernel.exception.PortalException {
182                    return getService()
183                                       .getCompanyMessagesRSS(companyId, status, max, type,
184                            version, displayStyle, feedURL, entryURL, themeDisplay);
185            }
186    
187            public static java.lang.String getGroupMessagesRSS(long groupId,
188                    int status, int max, java.lang.String type, double version,
189                    java.lang.String displayStyle, java.lang.String feedURL,
190                    java.lang.String entryURL,
191                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
192                    throws com.liferay.portal.kernel.exception.PortalException {
193                    return getService()
194                                       .getGroupMessagesRSS(groupId, status, max, type, version,
195                            displayStyle, feedURL, entryURL, themeDisplay);
196            }
197    
198            public static java.lang.String getGroupMessagesRSS(long groupId,
199                    long userId, int status, int max, java.lang.String type,
200                    double version, java.lang.String displayStyle,
201                    java.lang.String feedURL, java.lang.String entryURL,
202                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
203                    throws com.liferay.portal.kernel.exception.PortalException {
204                    return getService()
205                                       .getGroupMessagesRSS(groupId, userId, status, max, type,
206                            version, displayStyle, feedURL, entryURL, themeDisplay);
207            }
208    
209            /**
210            * Returns the OSGi service identifier.
211            *
212            * @return the OSGi service identifier
213            */
214            public static java.lang.String getOSGiServiceIdentifier() {
215                    return getService().getOSGiServiceIdentifier();
216            }
217    
218            public static java.lang.String getThreadMessagesRSS(long threadId,
219                    int status, int max, java.lang.String type, double version,
220                    java.lang.String displayStyle, java.lang.String feedURL,
221                    java.lang.String entryURL,
222                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
223                    throws com.liferay.portal.kernel.exception.PortalException {
224                    return getService()
225                                       .getThreadMessagesRSS(threadId, status, max, type, version,
226                            displayStyle, feedURL, entryURL, themeDisplay);
227            }
228    
229            public static java.util.List<com.liferay.message.boards.kernel.model.MBMessage> getCategoryMessages(
230                    long groupId, long categoryId, int status, int start, int end)
231                    throws com.liferay.portal.kernel.exception.PortalException {
232                    return getService()
233                                       .getCategoryMessages(groupId, categoryId, status, start, end);
234            }
235    
236            public static java.util.List<com.liferay.message.boards.kernel.model.MBMessage> getThreadMessages(
237                    long groupId, long categoryId, long threadId, int status, int start,
238                    int end) {
239                    return getService()
240                                       .getThreadMessages(groupId, categoryId, threadId, status,
241                            start, end);
242            }
243    
244            public static void addMessageAttachment(long messageId,
245                    java.lang.String fileName, java.io.File file, java.lang.String mimeType)
246                    throws com.liferay.portal.kernel.exception.PortalException {
247                    getService().addMessageAttachment(messageId, fileName, file, mimeType);
248            }
249    
250            /**
251            * @deprecated As of 7.0.0, replaced by {@link
252            #deleteDiscussionMessage(long)}
253            */
254            @Deprecated
255            public static void deleteDiscussionMessage(long groupId,
256                    java.lang.String className, long classPK,
257                    java.lang.String permissionClassName, long permissionClassPK,
258                    long permissionOwnerId, long messageId)
259                    throws com.liferay.portal.kernel.exception.PortalException {
260                    getService()
261                            .deleteDiscussionMessage(groupId, className, classPK,
262                            permissionClassName, permissionClassPK, permissionOwnerId, messageId);
263            }
264    
265            public static void deleteDiscussionMessage(long messageId)
266                    throws com.liferay.portal.kernel.exception.PortalException {
267                    getService().deleteDiscussionMessage(messageId);
268            }
269    
270            public static void deleteMessage(long messageId)
271                    throws com.liferay.portal.kernel.exception.PortalException {
272                    getService().deleteMessage(messageId);
273            }
274    
275            public static void deleteMessageAttachment(long messageId,
276                    java.lang.String fileName)
277                    throws com.liferay.portal.kernel.exception.PortalException {
278                    getService().deleteMessageAttachment(messageId, fileName);
279            }
280    
281            public static void deleteMessageAttachments(long messageId)
282                    throws com.liferay.portal.kernel.exception.PortalException {
283                    getService().deleteMessageAttachments(messageId);
284            }
285    
286            public static void emptyMessageAttachments(long messageId)
287                    throws com.liferay.portal.kernel.exception.PortalException {
288                    getService().emptyMessageAttachments(messageId);
289            }
290    
291            public static void restoreMessageAttachmentFromTrash(long messageId,
292                    java.lang.String fileName)
293                    throws com.liferay.portal.kernel.exception.PortalException {
294                    getService().restoreMessageAttachmentFromTrash(messageId, fileName);
295            }
296    
297            public static void subscribeMessage(long messageId)
298                    throws com.liferay.portal.kernel.exception.PortalException {
299                    getService().subscribeMessage(messageId);
300            }
301    
302            public static void unsubscribeMessage(long messageId)
303                    throws com.liferay.portal.kernel.exception.PortalException {
304                    getService().unsubscribeMessage(messageId);
305            }
306    
307            public static void updateAnswer(long messageId, boolean answer,
308                    boolean cascade)
309                    throws com.liferay.portal.kernel.exception.PortalException {
310                    getService().updateAnswer(messageId, answer, cascade);
311            }
312    
313            public static MBMessageService getService() {
314                    if (_service == null) {
315                            _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
316    
317                            ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
318                                    "_service");
319                    }
320    
321                    return _service;
322            }
323    
324            private static MBMessageService _service;
325    }