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.exportimport.kernel.lar.PortletDataContext;
020    
021    import com.liferay.message.boards.kernel.model.MBDiscussion;
022    import com.liferay.message.boards.kernel.model.MBMessage;
023    import com.liferay.message.boards.kernel.model.MBMessageDisplay;
024    
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.model.PersistedModel;
033    import com.liferay.portal.kernel.model.SystemEventConstants;
034    import com.liferay.portal.kernel.search.Indexable;
035    import com.liferay.portal.kernel.search.IndexableType;
036    import com.liferay.portal.kernel.service.BaseLocalService;
037    import com.liferay.portal.kernel.service.PersistedModelLocalService;
038    import com.liferay.portal.kernel.service.ServiceContext;
039    import com.liferay.portal.kernel.service.permission.ModelPermissions;
040    import com.liferay.portal.kernel.systemevent.SystemEvent;
041    import com.liferay.portal.kernel.transaction.Isolation;
042    import com.liferay.portal.kernel.transaction.Propagation;
043    import com.liferay.portal.kernel.transaction.Transactional;
044    import com.liferay.portal.kernel.util.ObjectValuePair;
045    import com.liferay.portal.kernel.util.OrderByComparator;
046    
047    import java.io.File;
048    import java.io.FileNotFoundException;
049    import java.io.InputStream;
050    import java.io.Serializable;
051    
052    import java.util.Comparator;
053    import java.util.List;
054    import java.util.Map;
055    
056    /**
057     * Provides the local service interface for MBMessage. Methods of this
058     * service will not have security checks based on the propagated JAAS
059     * credentials because this service can only be accessed from within the same
060     * VM.
061     *
062     * @author Brian Wing Shun Chan
063     * @see MBMessageLocalServiceUtil
064     * @see com.liferay.portlet.messageboards.service.base.MBMessageLocalServiceBaseImpl
065     * @see com.liferay.portlet.messageboards.service.impl.MBMessageLocalServiceImpl
066     * @generated
067     */
068    @ProviderType
069    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
070            PortalException.class, SystemException.class})
071    public interface MBMessageLocalService extends BaseLocalService,
072            PersistedModelLocalService {
073            /*
074             * NOTE FOR DEVELOPERS:
075             *
076             * Never modify or reference this interface directly. Always use {@link MBMessageLocalServiceUtil} to access the message-boards message local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBMessageLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
077             */
078            public MBMessage addDiscussionMessage(long userId,
079                    java.lang.String userName, long groupId, java.lang.String className,
080                    long classPK, long threadId, long parentMessageId,
081                    java.lang.String subject, java.lang.String body,
082                    ServiceContext serviceContext) throws PortalException;
083    
084            public MBMessage addDiscussionMessage(long userId,
085                    java.lang.String userName, long groupId, java.lang.String className,
086                    long classPK, int workflowAction) throws PortalException;
087    
088            /**
089            * Adds the message-boards message to the database. Also notifies the appropriate model listeners.
090            *
091            * @param mbMessage the message-boards message
092            * @return the message-boards message that was added
093            */
094            @Indexable(type = IndexableType.REINDEX)
095            public MBMessage addMBMessage(MBMessage mbMessage);
096    
097            /**
098            * @deprecated As of 7.0.0, replaced by {@link #addMessage(long, String,
099            long, long, String, String, ServiceContext)}
100            */
101            @java.lang.Deprecated
102            public MBMessage addMessage(long userId, java.lang.String userName,
103                    long categoryId, java.lang.String subject, java.lang.String body,
104                    ServiceContext serviceContext) throws PortalException;
105    
106            public MBMessage addMessage(long userId, java.lang.String userName,
107                    long groupId, long categoryId, java.lang.String subject,
108                    java.lang.String body, java.lang.String format,
109                    java.lang.String fileName, File file, boolean anonymous,
110                    double priority, boolean allowPingbacks, ServiceContext serviceContext)
111                    throws PortalException, FileNotFoundException;
112    
113            public MBMessage addMessage(long userId, java.lang.String userName,
114                    long groupId, long categoryId, java.lang.String subject,
115                    java.lang.String body, java.lang.String format,
116                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
117                    boolean anonymous, double priority, boolean allowPingbacks,
118                    ServiceContext serviceContext) throws PortalException;
119    
120            public MBMessage addMessage(long userId, java.lang.String userName,
121                    long groupId, long categoryId, java.lang.String subject,
122                    java.lang.String body, ServiceContext serviceContext)
123                    throws PortalException;
124    
125            public MBMessage addMessage(long userId, java.lang.String userName,
126                    long groupId, long categoryId, long threadId, long parentMessageId,
127                    java.lang.String subject, java.lang.String body,
128                    java.lang.String format,
129                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
130                    boolean anonymous, double priority, boolean allowPingbacks,
131                    ServiceContext serviceContext) throws PortalException;
132    
133            public void addMessageAttachment(long userId, long messageId,
134                    java.lang.String fileName, File file, java.lang.String mimeType)
135                    throws PortalException;
136    
137            public void addMessageResources(MBMessage message,
138                    boolean addGroupPermissions, boolean addGuestPermissions)
139                    throws PortalException;
140    
141            public void addMessageResources(MBMessage message,
142                    ModelPermissions modelPermissions) throws PortalException;
143    
144            public void addMessageResources(long messageId,
145                    boolean addGroupPermissions, boolean addGuestPermissions)
146                    throws PortalException;
147    
148            public void addMessageResources(long messageId,
149                    ModelPermissions modelPermissions) throws PortalException;
150    
151            /**
152            * Creates a new message-boards message with the primary key. Does not add the message-boards message to the database.
153            *
154            * @param messageId the primary key for the new message-boards message
155            * @return the new message-boards message
156            */
157            public MBMessage createMBMessage(long messageId);
158    
159            @Indexable(type = IndexableType.DELETE)
160            public MBMessage deleteDiscussionMessage(long messageId)
161                    throws PortalException;
162    
163            public void deleteDiscussionMessages(java.lang.String className,
164                    long classPK) throws PortalException;
165    
166            /**
167            * Deletes the message-boards message from the database. Also notifies the appropriate model listeners.
168            *
169            * @param mbMessage the message-boards message
170            * @return the message-boards message that was removed
171            */
172            @Indexable(type = IndexableType.DELETE)
173            public MBMessage deleteMBMessage(MBMessage mbMessage);
174    
175            /**
176            * Deletes the message-boards message with the primary key from the database. Also notifies the appropriate model listeners.
177            *
178            * @param messageId the primary key of the message-boards message
179            * @return the message-boards message that was removed
180            * @throws PortalException if a message-boards message with the primary key could not be found
181            */
182            @Indexable(type = IndexableType.DELETE)
183            public MBMessage deleteMBMessage(long messageId) throws PortalException;
184    
185            @Indexable(type = IndexableType.DELETE)
186            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
187            public MBMessage deleteMessage(MBMessage message) throws PortalException;
188    
189            @Indexable(type = IndexableType.DELETE)
190            public MBMessage deleteMessage(long messageId) throws PortalException;
191    
192            public void deleteMessageAttachment(long messageId,
193                    java.lang.String fileName) throws PortalException;
194    
195            public void deleteMessageAttachments(long messageId)
196                    throws PortalException;
197    
198            /**
199            * @throws PortalException
200            */
201            @Override
202            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
203                    throws PortalException;
204    
205            public DynamicQuery dynamicQuery();
206    
207            /**
208            * Performs a dynamic query on the database and returns the matching rows.
209            *
210            * @param dynamicQuery the dynamic query
211            * @return the matching rows
212            */
213            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
214    
215            /**
216            * Performs a dynamic query on the database and returns a range of the matching rows.
217            *
218            * <p>
219            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBMessageModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
220            * </p>
221            *
222            * @param dynamicQuery the dynamic query
223            * @param start the lower bound of the range of model instances
224            * @param end the upper bound of the range of model instances (not inclusive)
225            * @return the range of matching rows
226            */
227            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
228                    int end);
229    
230            /**
231            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
232            *
233            * <p>
234            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBMessageModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
235            * </p>
236            *
237            * @param dynamicQuery the dynamic query
238            * @param start the lower bound of the range of model instances
239            * @param end the upper bound of the range of model instances (not inclusive)
240            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
241            * @return the ordered range of matching rows
242            */
243            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
244                    int end, OrderByComparator<T> orderByComparator);
245    
246            /**
247            * Returns the number of rows matching the dynamic query.
248            *
249            * @param dynamicQuery the dynamic query
250            * @return the number of rows matching the dynamic query
251            */
252            public long dynamicQueryCount(DynamicQuery dynamicQuery);
253    
254            /**
255            * Returns the number of rows matching the dynamic query.
256            *
257            * @param dynamicQuery the dynamic query
258            * @param projection the projection to apply to the query
259            * @return the number of rows matching the dynamic query
260            */
261            public long dynamicQueryCount(DynamicQuery dynamicQuery,
262                    Projection projection);
263    
264            public void emptyMessageAttachments(long messageId)
265                    throws PortalException;
266    
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public MBMessage fetchMBMessage(long messageId);
269    
270            /**
271            * Returns the message-boards message matching the UUID and group.
272            *
273            * @param uuid the message-boards message's UUID
274            * @param groupId the primary key of the group
275            * @return the matching message-boards message, or <code>null</code> if a matching message-boards message could not be found
276            */
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public MBMessage fetchMBMessageByUuidAndGroupId(java.lang.String uuid,
279                    long groupId);
280    
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public ActionableDynamicQuery getActionableDynamicQuery();
283    
284            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
285            public List<MBMessage> getCategoryMessages(long groupId, long categoryId,
286                    int status, int start, int end);
287    
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public List<MBMessage> getCategoryMessages(long groupId, long categoryId,
290                    int status, int start, int end, OrderByComparator<MBMessage> obc);
291    
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public int getCategoryMessagesCount(long groupId, long categoryId,
294                    int status);
295    
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public List<MBMessage> getCompanyMessages(long companyId, int status,
298                    int start, int end);
299    
300            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
301            public List<MBMessage> getCompanyMessages(long companyId, int status,
302                    int start, int end, OrderByComparator<MBMessage> obc);
303    
304            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
305            public int getCompanyMessagesCount(long companyId, int status);
306    
307            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
308            public MBMessageDisplay getDiscussionMessageDisplay(long userId,
309                    long groupId, java.lang.String className, long classPK, int status)
310                    throws PortalException;
311    
312            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
313            public MBMessageDisplay getDiscussionMessageDisplay(long userId,
314                    long groupId, java.lang.String className, long classPK, int status,
315                    Comparator<MBMessage> comparator) throws PortalException;
316    
317            /**
318            * @deprecated As of 7.0.0, replaced by {@link
319            #getDiscussionMessageDisplay(long, long, String, long, int)}
320            */
321            @java.lang.Deprecated
322            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323            public MBMessageDisplay getDiscussionMessageDisplay(long userId,
324                    long groupId, java.lang.String className, long classPK, int status,
325                    java.lang.String threadView) throws PortalException;
326    
327            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
328            public int getDiscussionMessagesCount(java.lang.String className,
329                    long classPK, int status);
330    
331            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
332            public int getDiscussionMessagesCount(long classNameId, long classPK,
333                    int status);
334    
335            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336            public List<MBDiscussion> getDiscussions(java.lang.String className);
337    
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
340                    PortletDataContext portletDataContext);
341    
342            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
343            public List<MBMessage> getGroupMessages(long groupId, int status,
344                    int start, int end);
345    
346            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
347            public List<MBMessage> getGroupMessages(long groupId, int status,
348                    int start, int end, OrderByComparator<MBMessage> obc);
349    
350            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
351            public List<MBMessage> getGroupMessages(long groupId, long userId,
352                    int status, int start, int end);
353    
354            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
355            public List<MBMessage> getGroupMessages(long groupId, long userId,
356                    int status, int start, int end, OrderByComparator<MBMessage> obc);
357    
358            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
359            public int getGroupMessagesCount(long groupId, int status);
360    
361            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
362            public int getGroupMessagesCount(long groupId, long userId, int status);
363    
364            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
365            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
366    
367            /**
368            * Returns the message-boards message with the primary key.
369            *
370            * @param messageId the primary key of the message-boards message
371            * @return the message-boards message
372            * @throws PortalException if a message-boards message with the primary key could not be found
373            */
374            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
375            public MBMessage getMBMessage(long messageId) throws PortalException;
376    
377            /**
378            * Returns the message-boards message matching the UUID and group.
379            *
380            * @param uuid the message-boards message's UUID
381            * @param groupId the primary key of the group
382            * @return the matching message-boards message
383            * @throws PortalException if a matching message-boards message could not be found
384            */
385            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
386            public MBMessage getMBMessageByUuidAndGroupId(java.lang.String uuid,
387                    long groupId) throws PortalException;
388    
389            /**
390            * Returns a range of all the message-boards messages.
391            *
392            * <p>
393            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBMessageModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
394            * </p>
395            *
396            * @param start the lower bound of the range of message-boards messages
397            * @param end the upper bound of the range of message-boards messages (not inclusive)
398            * @return the range of message-boards messages
399            */
400            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
401            public List<MBMessage> getMBMessages(int start, int end);
402    
403            /**
404            * Returns all the message-boards messages matching the UUID and company.
405            *
406            * @param uuid the UUID of the message-boards messages
407            * @param companyId the primary key of the company
408            * @return the matching message-boards messages, or an empty list if no matches were found
409            */
410            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
411            public List<MBMessage> getMBMessagesByUuidAndCompanyId(
412                    java.lang.String uuid, long companyId);
413    
414            /**
415            * Returns a range of message-boards messages matching the UUID and company.
416            *
417            * @param uuid the UUID of the message-boards messages
418            * @param companyId the primary key of the company
419            * @param start the lower bound of the range of message-boards messages
420            * @param end the upper bound of the range of message-boards messages (not inclusive)
421            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
422            * @return the range of matching message-boards messages, or an empty list if no matches were found
423            */
424            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
425            public List<MBMessage> getMBMessagesByUuidAndCompanyId(
426                    java.lang.String uuid, long companyId, int start, int end,
427                    OrderByComparator<MBMessage> orderByComparator);
428    
429            /**
430            * Returns the number of message-boards messages.
431            *
432            * @return the number of message-boards messages
433            */
434            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
435            public int getMBMessagesCount();
436    
437            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
438            public MBMessage getMessage(long messageId) throws PortalException;
439    
440            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
441            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
442                    int status) throws PortalException;
443    
444            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
445            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
446                    int status, Comparator<MBMessage> comparator) throws PortalException;
447    
448            /**
449            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
450            MBMessage, int)}
451            */
452            @java.lang.Deprecated
453            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
454            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
455                    int status, java.lang.String threadView, boolean includePrevAndNext)
456                    throws PortalException;
457    
458            /**
459            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
460            MBMessage, int, Comparator)} (
461            */
462            @java.lang.Deprecated
463            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
464            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
465                    int status, java.lang.String threadView, boolean includePrevAndNext,
466                    Comparator<MBMessage> comparator) throws PortalException;
467    
468            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
469            public MBMessageDisplay getMessageDisplay(long userId, long messageId,
470                    int status) throws PortalException;
471    
472            /**
473            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
474            long, int)}
475            */
476            @java.lang.Deprecated
477            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
478            public MBMessageDisplay getMessageDisplay(long userId, long messageId,
479                    int status, java.lang.String threadView, boolean includePrevAndNext)
480                    throws PortalException;
481    
482            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
483            public List<MBMessage> getMessages(java.lang.String className,
484                    long classPK, int status);
485    
486            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
487            public List<MBMessage> getNoAssetMessages();
488    
489            /**
490            * Returns the OSGi service identifier.
491            *
492            * @return the OSGi service identifier
493            */
494            public java.lang.String getOSGiServiceIdentifier();
495    
496            @Override
497            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
498            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
499                    throws PortalException;
500    
501            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
502            public int getPositionInThread(long messageId) throws PortalException;
503    
504            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
505            public List<MBMessage> getThreadMessages(long threadId, int status);
506    
507            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
508            public List<MBMessage> getThreadMessages(long threadId, int status,
509                    Comparator<MBMessage> comparator);
510    
511            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
512            public List<MBMessage> getThreadMessages(long threadId, int status,
513                    int start, int end);
514    
515            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
516            public int getThreadMessagesCount(long threadId, int status);
517    
518            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
519            public List<MBMessage> getThreadRepliesMessages(long threadId, int status,
520                    int start, int end);
521    
522            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
523            public List<MBMessage> getUserDiscussionMessages(long userId,
524                    java.lang.String className, long classPK, int status, int start,
525                    int end, OrderByComparator<MBMessage> obc);
526    
527            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
528            public List<MBMessage> getUserDiscussionMessages(long userId,
529                    long classNameId, long classPK, int status, int start, int end,
530                    OrderByComparator<MBMessage> obc);
531    
532            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
533            public List<MBMessage> getUserDiscussionMessages(long userId,
534                    long[] classNameIds, int status, int start, int end,
535                    OrderByComparator<MBMessage> obc);
536    
537            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
538            public int getUserDiscussionMessagesCount(long userId,
539                    java.lang.String className, long classPK, int status);
540    
541            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
542            public int getUserDiscussionMessagesCount(long userId, long classNameId,
543                    long classPK, int status);
544    
545            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
546            public int getUserDiscussionMessagesCount(long userId, long[] classNameIds,
547                    int status);
548    
549            public long moveMessageAttachmentToTrash(long userId, long messageId,
550                    java.lang.String fileName) throws PortalException;
551    
552            public void restoreMessageAttachmentFromTrash(long userId, long messageId,
553                    java.lang.String deletedFileName) throws PortalException;
554    
555            public void subscribeMessage(long userId, long messageId)
556                    throws PortalException;
557    
558            public void unsubscribeMessage(long userId, long messageId)
559                    throws PortalException;
560    
561            public void updateAnswer(MBMessage message, boolean answer, boolean cascade)
562                    throws PortalException;
563    
564            public void updateAnswer(long messageId, boolean answer, boolean cascade)
565                    throws PortalException;
566    
567            public void updateAsset(long userId, MBMessage message,
568                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
569                    long[] assetLinkEntryIds) throws PortalException;
570    
571            public MBMessage updateDiscussionMessage(long userId, long messageId,
572                    java.lang.String className, long classPK, java.lang.String subject,
573                    java.lang.String body, ServiceContext serviceContext)
574                    throws PortalException;
575    
576            /**
577            * Updates the message-boards message in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
578            *
579            * @param mbMessage the message-boards message
580            * @return the message-boards message that was updated
581            */
582            @Indexable(type = IndexableType.REINDEX)
583            public MBMessage updateMBMessage(MBMessage mbMessage);
584    
585            /**
586            * @deprecated As of 7.0.0, with no direct replacement
587            */
588            @java.lang.Deprecated
589            public MBMessage updateMessage(long messageId, java.lang.String body)
590                    throws PortalException;
591    
592            public MBMessage updateMessage(long userId, long messageId,
593                    java.lang.String body, ServiceContext serviceContext)
594                    throws PortalException;
595    
596            public MBMessage updateMessage(long userId, long messageId,
597                    java.lang.String subject, java.lang.String body,
598                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
599                    List<java.lang.String> existingFiles, double priority,
600                    boolean allowPingbacks, ServiceContext serviceContext)
601                    throws PortalException;
602    
603            /**
604            * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, long,
605            int, ServiceContext, Map)}
606            */
607            @java.lang.Deprecated
608            public MBMessage updateStatus(long userId, long messageId, int status,
609                    ServiceContext serviceContext) throws PortalException;
610    
611            public MBMessage updateStatus(long userId, long messageId, int status,
612                    ServiceContext serviceContext,
613                    Map<java.lang.String, Serializable> workflowContext)
614                    throws PortalException;
615    
616            public void updateUserName(long userId, java.lang.String userName);
617    }