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.MBMessage;
022    import com.liferay.message.boards.kernel.model.MBThread;
023    
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.Projection;
029    import com.liferay.portal.kernel.dao.orm.QueryDefinition;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.increment.BufferedIncrement;
033    import com.liferay.portal.kernel.model.PersistedModel;
034    import com.liferay.portal.kernel.model.SystemEventConstants;
035    import com.liferay.portal.kernel.search.Hits;
036    import com.liferay.portal.kernel.search.Indexable;
037    import com.liferay.portal.kernel.search.IndexableType;
038    import com.liferay.portal.kernel.service.BaseLocalService;
039    import com.liferay.portal.kernel.service.PersistedModelLocalService;
040    import com.liferay.portal.kernel.service.ServiceContext;
041    import com.liferay.portal.kernel.systemevent.SystemEvent;
042    import com.liferay.portal.kernel.transaction.Isolation;
043    import com.liferay.portal.kernel.transaction.Propagation;
044    import com.liferay.portal.kernel.transaction.Transactional;
045    import com.liferay.portal.kernel.util.OrderByComparator;
046    
047    import java.io.Serializable;
048    
049    import java.util.List;
050    
051    /**
052     * Provides the local service interface for MBThread. Methods of this
053     * service will not have security checks based on the propagated JAAS
054     * credentials because this service can only be accessed from within the same
055     * VM.
056     *
057     * @author Brian Wing Shun Chan
058     * @see MBThreadLocalServiceUtil
059     * @see com.liferay.portlet.messageboards.service.base.MBThreadLocalServiceBaseImpl
060     * @see com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl
061     * @generated
062     */
063    @ProviderType
064    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
065            PortalException.class, SystemException.class})
066    public interface MBThreadLocalService extends BaseLocalService,
067            PersistedModelLocalService {
068            /*
069             * NOTE FOR DEVELOPERS:
070             *
071             * Never modify or reference this interface directly. Always use {@link MBThreadLocalServiceUtil} to access the message boards thread local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
072             */
073    
074            /**
075            * Adds the message boards thread to the database. Also notifies the appropriate model listeners.
076            *
077            * @param mbThread the message boards thread
078            * @return the message boards thread that was added
079            */
080            @Indexable(type = IndexableType.REINDEX)
081            public MBThread addMBThread(MBThread mbThread);
082    
083            public MBThread addThread(long categoryId, MBMessage message,
084                    ServiceContext serviceContext) throws PortalException;
085    
086            /**
087            * Creates a new message boards thread with the primary key. Does not add the message boards thread to the database.
088            *
089            * @param threadId the primary key for the new message boards thread
090            * @return the new message boards thread
091            */
092            public MBThread createMBThread(long threadId);
093    
094            /**
095            * Deletes the message boards thread from the database. Also notifies the appropriate model listeners.
096            *
097            * @param mbThread the message boards thread
098            * @return the message boards thread that was removed
099            */
100            @Indexable(type = IndexableType.DELETE)
101            public MBThread deleteMBThread(MBThread mbThread);
102    
103            /**
104            * Deletes the message boards thread with the primary key from the database. Also notifies the appropriate model listeners.
105            *
106            * @param threadId the primary key of the message boards thread
107            * @return the message boards thread that was removed
108            * @throws PortalException if a message boards thread with the primary key could not be found
109            */
110            @Indexable(type = IndexableType.DELETE)
111            public MBThread deleteMBThread(long threadId) throws PortalException;
112    
113            /**
114            * @throws PortalException
115            */
116            @Override
117            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
118                    throws PortalException;
119    
120            @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
121            public void deleteThread(MBThread thread) throws PortalException;
122    
123            public void deleteThread(long threadId) throws PortalException;
124    
125            public void deleteThreads(long groupId, long categoryId)
126                    throws PortalException;
127    
128            public void deleteThreads(long groupId, long categoryId,
129                    boolean includeTrashedEntries) throws PortalException;
130    
131            public DynamicQuery dynamicQuery();
132    
133            /**
134            * Performs a dynamic query on the database and returns the matching rows.
135            *
136            * @param dynamicQuery the dynamic query
137            * @return the matching rows
138            */
139            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
140    
141            /**
142            * Performs a dynamic query on the database and returns a range of the matching rows.
143            *
144            * <p>
145            * 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.MBThreadModelImpl}. 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.
146            * </p>
147            *
148            * @param dynamicQuery the dynamic query
149            * @param start the lower bound of the range of model instances
150            * @param end the upper bound of the range of model instances (not inclusive)
151            * @return the range of matching rows
152            */
153            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
154                    int end);
155    
156            /**
157            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
158            *
159            * <p>
160            * 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.MBThreadModelImpl}. 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.
161            * </p>
162            *
163            * @param dynamicQuery the dynamic query
164            * @param start the lower bound of the range of model instances
165            * @param end the upper bound of the range of model instances (not inclusive)
166            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
167            * @return the ordered range of matching rows
168            */
169            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
170                    int end, OrderByComparator<T> orderByComparator);
171    
172            /**
173            * Returns the number of rows matching the dynamic query.
174            *
175            * @param dynamicQuery the dynamic query
176            * @return the number of rows matching the dynamic query
177            */
178            public long dynamicQueryCount(DynamicQuery dynamicQuery);
179    
180            /**
181            * Returns the number of rows matching the dynamic query.
182            *
183            * @param dynamicQuery the dynamic query
184            * @param projection the projection to apply to the query
185            * @return the number of rows matching the dynamic query
186            */
187            public long dynamicQueryCount(DynamicQuery dynamicQuery,
188                    Projection projection);
189    
190            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191            public MBThread fetchMBThread(long threadId);
192    
193            /**
194            * Returns the message boards thread matching the UUID and group.
195            *
196            * @param uuid the message boards thread's UUID
197            * @param groupId the primary key of the group
198            * @return the matching message boards thread, or <code>null</code> if a matching message boards thread could not be found
199            */
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public MBThread fetchMBThreadByUuidAndGroupId(java.lang.String uuid,
202                    long groupId);
203    
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public MBThread fetchThread(long threadId);
206    
207            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
208            public ActionableDynamicQuery getActionableDynamicQuery();
209    
210            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211            public int getCategoryThreadsCount(long groupId, long categoryId, int status);
212    
213            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
215                    PortletDataContext portletDataContext);
216    
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public List<MBThread> getGroupThreads(long groupId,
219                    QueryDefinition<MBThread> queryDefinition);
220    
221            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
222            public List<MBThread> getGroupThreads(long groupId, long userId,
223                    QueryDefinition<MBThread> queryDefinition);
224    
225            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
226            public List<MBThread> getGroupThreads(long groupId, long userId,
227                    boolean subscribed, boolean includeAnonymous,
228                    QueryDefinition<MBThread> queryDefinition);
229    
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public List<MBThread> getGroupThreads(long groupId, long userId,
232                    boolean subscribed, QueryDefinition<MBThread> queryDefinition);
233    
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public int getGroupThreadsCount(long groupId,
236                    QueryDefinition<MBThread> queryDefinition);
237    
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public int getGroupThreadsCount(long groupId, long userId,
240                    QueryDefinition<MBThread> queryDefinition);
241    
242            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
243            public int getGroupThreadsCount(long groupId, long userId,
244                    boolean subscribed, boolean includeAnonymous,
245                    QueryDefinition<MBThread> queryDefinition);
246    
247            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
248            public int getGroupThreadsCount(long groupId, long userId,
249                    boolean subscribed, QueryDefinition<MBThread> queryDefinition);
250    
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
253    
254            /**
255            * Returns the message boards thread with the primary key.
256            *
257            * @param threadId the primary key of the message boards thread
258            * @return the message boards thread
259            * @throws PortalException if a message boards thread with the primary key could not be found
260            */
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public MBThread getMBThread(long threadId) throws PortalException;
263    
264            /**
265            * Returns the message boards thread matching the UUID and group.
266            *
267            * @param uuid the message boards thread's UUID
268            * @param groupId the primary key of the group
269            * @return the matching message boards thread
270            * @throws PortalException if a matching message boards thread could not be found
271            */
272            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
273            public MBThread getMBThreadByUuidAndGroupId(java.lang.String uuid,
274                    long groupId) throws PortalException;
275    
276            /**
277            * Returns a range of all the message boards threads.
278            *
279            * <p>
280            * 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.MBThreadModelImpl}. 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.
281            * </p>
282            *
283            * @param start the lower bound of the range of message boards threads
284            * @param end the upper bound of the range of message boards threads (not inclusive)
285            * @return the range of message boards threads
286            */
287            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288            public List<MBThread> getMBThreads(int start, int end);
289    
290            /**
291            * Returns all the message boards threads matching the UUID and company.
292            *
293            * @param uuid the UUID of the message boards threads
294            * @param companyId the primary key of the company
295            * @return the matching message boards threads, or an empty list if no matches were found
296            */
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public List<MBThread> getMBThreadsByUuidAndCompanyId(
299                    java.lang.String uuid, long companyId);
300    
301            /**
302            * Returns a range of message boards threads matching the UUID and company.
303            *
304            * @param uuid the UUID of the message boards threads
305            * @param companyId the primary key of the company
306            * @param start the lower bound of the range of message boards threads
307            * @param end the upper bound of the range of message boards threads (not inclusive)
308            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
309            * @return the range of matching message boards threads, or an empty list if no matches were found
310            */
311            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312            public List<MBThread> getMBThreadsByUuidAndCompanyId(
313                    java.lang.String uuid, long companyId, int start, int end,
314                    OrderByComparator<MBThread> orderByComparator);
315    
316            /**
317            * Returns the number of message boards threads.
318            *
319            * @return the number of message boards threads
320            */
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public int getMBThreadsCount();
323    
324            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325            public List<MBThread> getNoAssetThreads();
326    
327            /**
328            * Returns the OSGi service identifier.
329            *
330            * @return the OSGi service identifier
331            */
332            public java.lang.String getOSGiServiceIdentifier();
333    
334            @Override
335            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
337                    throws PortalException;
338    
339            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
340            public List<MBThread> getPriorityThreads(long categoryId, double priority)
341                    throws PortalException;
342    
343            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
344            public List<MBThread> getPriorityThreads(long categoryId, double priority,
345                    boolean inherit) throws PortalException;
346    
347            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
348            public MBThread getThread(long threadId) throws PortalException;
349    
350            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
351            public List<MBThread> getThreads(long groupId, long categoryId, int status,
352                    int start, int end);
353    
354            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
355            public int getThreadsCount(long groupId, long categoryId, int status);
356    
357            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
358            public boolean hasAnswerMessage(long threadId);
359    
360            @BufferedIncrement(configuration = "MBThread", incrementClass = com.liferay.portal.kernel.increment.NumberIncrement.class)
361            public void incrementViewCounter(long threadId, int increment)
362                    throws PortalException;
363    
364            public void moveDependentsToTrash(long groupId, long threadId,
365                    long trashEntryId) throws PortalException;
366    
367            public MBThread moveThread(long groupId, long categoryId, long threadId)
368                    throws PortalException;
369    
370            public MBThread moveThreadFromTrash(long userId, long categoryId,
371                    long threadId) throws PortalException;
372    
373            public MBThread moveThreadToTrash(long userId, MBThread thread)
374                    throws PortalException;
375    
376            public MBThread moveThreadToTrash(long userId, long threadId)
377                    throws PortalException;
378    
379            public void moveThreadsToTrash(long groupId, long userId)
380                    throws PortalException;
381    
382            public void restoreDependentsFromTrash(long groupId, long threadId)
383                    throws PortalException;
384    
385            /**
386            * @deprecated As of 7.0.0, replaced by {@link
387            #restoreDependentsFromTrash(long, long)}
388            */
389            @java.lang.Deprecated
390            public void restoreDependentsFromTrash(long groupId, long threadId,
391                    long trashEntryId) throws PortalException;
392    
393            public void restoreThreadFromTrash(long userId, long threadId)
394                    throws PortalException;
395    
396            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
397            public Hits search(long groupId, long userId, long creatorUserId,
398                    long startDate, long endDate, int status, int start, int end)
399                    throws PortalException;
400    
401            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
402            public Hits search(long groupId, long userId, long creatorUserId,
403                    int status, int start, int end) throws PortalException;
404    
405            public MBThread splitThread(long userId, long messageId,
406                    java.lang.String subject, ServiceContext serviceContext)
407                    throws PortalException;
408    
409            /**
410            * Updates the message boards thread in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
411            *
412            * @param mbThread the message boards thread
413            * @return the message boards thread that was updated
414            */
415            @Indexable(type = IndexableType.REINDEX)
416            public MBThread updateMBThread(MBThread mbThread);
417    
418            public MBThread updateMessageCount(long threadId);
419    
420            public void updateQuestion(long threadId, boolean question)
421                    throws PortalException;
422    
423            public MBThread updateStatus(long userId, long threadId, int status)
424                    throws PortalException;
425    }