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 void addMessageAttachment(long messageId,
098                    java.lang.String fileName, java.io.File file, java.lang.String mimeType)
099                    throws com.liferay.portal.kernel.exception.PortalException {
100                    getService().addMessageAttachment(messageId, fileName, file, mimeType);
101            }
102    
103            /**
104            * @deprecated As of 7.0.0, replaced by {@link
105            #deleteDiscussionMessage(long)}
106            */
107            @Deprecated
108            public static void deleteDiscussionMessage(long groupId,
109                    java.lang.String className, long classPK,
110                    java.lang.String permissionClassName, long permissionClassPK,
111                    long permissionOwnerId, long messageId)
112                    throws com.liferay.portal.kernel.exception.PortalException {
113                    getService()
114                            .deleteDiscussionMessage(groupId, className, classPK,
115                            permissionClassName, permissionClassPK, permissionOwnerId, messageId);
116            }
117    
118            public static void deleteDiscussionMessage(long messageId)
119                    throws com.liferay.portal.kernel.exception.PortalException {
120                    getService().deleteDiscussionMessage(messageId);
121            }
122    
123            public static void deleteMessage(long messageId)
124                    throws com.liferay.portal.kernel.exception.PortalException {
125                    getService().deleteMessage(messageId);
126            }
127    
128            public static void deleteMessageAttachment(long messageId,
129                    java.lang.String fileName)
130                    throws com.liferay.portal.kernel.exception.PortalException {
131                    getService().deleteMessageAttachment(messageId, fileName);
132            }
133    
134            public static void deleteMessageAttachments(long messageId)
135                    throws com.liferay.portal.kernel.exception.PortalException {
136                    getService().deleteMessageAttachments(messageId);
137            }
138    
139            public static void emptyMessageAttachments(long messageId)
140                    throws com.liferay.portal.kernel.exception.PortalException {
141                    getService().emptyMessageAttachments(messageId);
142            }
143    
144            public static java.util.List<com.liferay.message.boards.kernel.model.MBMessage> getCategoryMessages(
145                    long groupId, long categoryId, int status, int start, int end)
146                    throws com.liferay.portal.kernel.exception.PortalException {
147                    return getService()
148                                       .getCategoryMessages(groupId, categoryId, status, start, end);
149            }
150    
151            public static int getCategoryMessagesCount(long groupId, long categoryId,
152                    int status) {
153                    return getService().getCategoryMessagesCount(groupId, categoryId, status);
154            }
155    
156            public static java.lang.String getCategoryMessagesRSS(long groupId,
157                    long categoryId, int status, int max, java.lang.String type,
158                    double version, java.lang.String displayStyle,
159                    java.lang.String feedURL, java.lang.String entryURL,
160                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
161                    throws com.liferay.portal.kernel.exception.PortalException {
162                    return getService()
163                                       .getCategoryMessagesRSS(groupId, categoryId, status, max,
164                            type, version, displayStyle, feedURL, entryURL, themeDisplay);
165            }
166    
167            public static java.lang.String getCompanyMessagesRSS(long companyId,
168                    int status, int max, java.lang.String type, double version,
169                    java.lang.String displayStyle, java.lang.String feedURL,
170                    java.lang.String entryURL,
171                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
172                    throws com.liferay.portal.kernel.exception.PortalException {
173                    return getService()
174                                       .getCompanyMessagesRSS(companyId, status, max, type,
175                            version, displayStyle, feedURL, entryURL, themeDisplay);
176            }
177    
178            public static int getGroupMessagesCount(long groupId, int status) {
179                    return getService().getGroupMessagesCount(groupId, status);
180            }
181    
182            public static java.lang.String getGroupMessagesRSS(long groupId,
183                    int status, int max, java.lang.String type, double version,
184                    java.lang.String displayStyle, java.lang.String feedURL,
185                    java.lang.String entryURL,
186                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
187                    throws com.liferay.portal.kernel.exception.PortalException {
188                    return getService()
189                                       .getGroupMessagesRSS(groupId, status, max, type, version,
190                            displayStyle, feedURL, entryURL, themeDisplay);
191            }
192    
193            public static java.lang.String getGroupMessagesRSS(long groupId,
194                    long userId, int status, int max, java.lang.String type,
195                    double version, java.lang.String displayStyle,
196                    java.lang.String feedURL, java.lang.String entryURL,
197                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
198                    throws com.liferay.portal.kernel.exception.PortalException {
199                    return getService()
200                                       .getGroupMessagesRSS(groupId, userId, status, max, type,
201                            version, displayStyle, feedURL, entryURL, themeDisplay);
202            }
203    
204            public static com.liferay.message.boards.kernel.model.MBMessage getMessage(
205                    long messageId)
206                    throws com.liferay.portal.kernel.exception.PortalException {
207                    return getService().getMessage(messageId);
208            }
209    
210            public static com.liferay.message.boards.kernel.model.MBMessageDisplay getMessageDisplay(
211                    long messageId, int status)
212                    throws com.liferay.portal.kernel.exception.PortalException {
213                    return getService().getMessageDisplay(messageId, status);
214            }
215    
216            /**
217            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
218            int)}
219            */
220            @Deprecated
221            public static com.liferay.message.boards.kernel.model.MBMessageDisplay getMessageDisplay(
222                    long messageId, int status, java.lang.String threadView,
223                    boolean includePrevAndNext)
224                    throws com.liferay.portal.kernel.exception.PortalException {
225                    return getService()
226                                       .getMessageDisplay(messageId, status, threadView,
227                            includePrevAndNext);
228            }
229    
230            /**
231            * Returns the OSGi service identifier.
232            *
233            * @return the OSGi service identifier
234            */
235            public static java.lang.String getOSGiServiceIdentifier() {
236                    return getService().getOSGiServiceIdentifier();
237            }
238    
239            public static int getThreadAnswersCount(long groupId, long categoryId,
240                    long threadId) {
241                    return getService().getThreadAnswersCount(groupId, categoryId, threadId);
242            }
243    
244            public static java.util.List<com.liferay.message.boards.kernel.model.MBMessage> getThreadMessages(
245                    long groupId, long categoryId, long threadId, int status, int start,
246                    int end) {
247                    return getService()
248                                       .getThreadMessages(groupId, categoryId, threadId, status,
249                            start, end);
250            }
251    
252            public static int getThreadMessagesCount(long groupId, long categoryId,
253                    long threadId, int status) {
254                    return getService()
255                                       .getThreadMessagesCount(groupId, categoryId, threadId, status);
256            }
257    
258            public static java.lang.String getThreadMessagesRSS(long threadId,
259                    int status, int max, java.lang.String type, double version,
260                    java.lang.String displayStyle, java.lang.String feedURL,
261                    java.lang.String entryURL,
262                    com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
263                    throws com.liferay.portal.kernel.exception.PortalException {
264                    return getService()
265                                       .getThreadMessagesRSS(threadId, status, max, type, version,
266                            displayStyle, feedURL, entryURL, themeDisplay);
267            }
268    
269            public static void restoreMessageAttachmentFromTrash(long messageId,
270                    java.lang.String fileName)
271                    throws com.liferay.portal.kernel.exception.PortalException {
272                    getService().restoreMessageAttachmentFromTrash(messageId, fileName);
273            }
274    
275            public static void subscribeMessage(long messageId)
276                    throws com.liferay.portal.kernel.exception.PortalException {
277                    getService().subscribeMessage(messageId);
278            }
279    
280            public static void unsubscribeMessage(long messageId)
281                    throws com.liferay.portal.kernel.exception.PortalException {
282                    getService().unsubscribeMessage(messageId);
283            }
284    
285            public static void updateAnswer(long messageId, boolean answer,
286                    boolean cascade)
287                    throws com.liferay.portal.kernel.exception.PortalException {
288                    getService().updateAnswer(messageId, answer, cascade);
289            }
290    
291            public static com.liferay.message.boards.kernel.model.MBMessage updateDiscussionMessage(
292                    java.lang.String className, long classPK, long messageId,
293                    java.lang.String subject, java.lang.String body,
294                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
295                    throws com.liferay.portal.kernel.exception.PortalException {
296                    return getService()
297                                       .updateDiscussionMessage(className, classPK, messageId,
298                            subject, body, serviceContext);
299            }
300    
301            public static com.liferay.message.boards.kernel.model.MBMessage updateMessage(
302                    long messageId, java.lang.String subject, java.lang.String body,
303                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
304                    java.util.List<java.lang.String> existingFiles, double priority,
305                    boolean allowPingbacks,
306                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
307                    throws com.liferay.portal.kernel.exception.PortalException {
308                    return getService()
309                                       .updateMessage(messageId, subject, body, inputStreamOVPs,
310                            existingFiles, priority, allowPingbacks, serviceContext);
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    }