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.portlet.messageboards.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.transaction.Isolation;
029    import com.liferay.portal.kernel.transaction.Propagation;
030    import com.liferay.portal.kernel.transaction.Transactional;
031    import com.liferay.portal.kernel.util.OrderByComparator;
032    import com.liferay.portal.model.PersistedModel;
033    import com.liferay.portal.service.BaseLocalService;
034    import com.liferay.portal.service.PersistedModelLocalService;
035    import com.liferay.portal.service.ServiceContext;
036    
037    import com.liferay.portlet.exportimport.lar.PortletDataContext;
038    import com.liferay.portlet.messageboards.model.MBDiscussion;
039    
040    import java.io.Serializable;
041    
042    import java.util.List;
043    
044    /**
045     * Provides the local service interface for MBDiscussion. Methods of this
046     * service will not have security checks based on the propagated JAAS
047     * credentials because this service can only be accessed from within the same
048     * VM.
049     *
050     * @author Brian Wing Shun Chan
051     * @see MBDiscussionLocalServiceUtil
052     * @see com.liferay.portlet.messageboards.service.base.MBDiscussionLocalServiceBaseImpl
053     * @see com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl
054     * @generated
055     */
056    @ProviderType
057    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
058            PortalException.class, SystemException.class})
059    public interface MBDiscussionLocalService extends BaseLocalService,
060            PersistedModelLocalService {
061            /*
062             * NOTE FOR DEVELOPERS:
063             *
064             * Never modify or reference this interface directly. Always use {@link MBDiscussionLocalServiceUtil} to access the message boards discussion local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
065             */
066    
067            /**
068            * @deprecated As of 7.0.0, replaced by {@link #addDiscussion(long, long,
069            long, long, long, ServiceContext)}
070            */
071            @java.lang.Deprecated
072            public MBDiscussion addDiscussion(long userId, long classNameId,
073                    long classPK, long threadId, ServiceContext serviceContext)
074                    throws PortalException;
075    
076            public MBDiscussion addDiscussion(long userId, long groupId,
077                    long classNameId, long classPK, long threadId,
078                    ServiceContext serviceContext) throws PortalException;
079    
080            /**
081            * Adds the message boards discussion to the database. Also notifies the appropriate model listeners.
082            *
083            * @param mbDiscussion the message boards discussion
084            * @return the message boards discussion that was added
085            */
086            @Indexable(type = IndexableType.REINDEX)
087            public MBDiscussion addMBDiscussion(MBDiscussion mbDiscussion);
088    
089            /**
090            * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database.
091            *
092            * @param discussionId the primary key for the new message boards discussion
093            * @return the new message boards discussion
094            */
095            public MBDiscussion createMBDiscussion(long discussionId);
096    
097            /**
098            * Deletes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners.
099            *
100            * @param discussionId the primary key of the message boards discussion
101            * @return the message boards discussion that was removed
102            * @throws PortalException if a message boards discussion with the primary key could not be found
103            */
104            @Indexable(type = IndexableType.DELETE)
105            public MBDiscussion deleteMBDiscussion(long discussionId)
106                    throws PortalException;
107    
108            /**
109            * Deletes the message boards discussion from the database. Also notifies the appropriate model listeners.
110            *
111            * @param mbDiscussion the message boards discussion
112            * @return the message boards discussion that was removed
113            */
114            @Indexable(type = IndexableType.DELETE)
115            public MBDiscussion deleteMBDiscussion(MBDiscussion mbDiscussion);
116    
117            /**
118            * @throws PortalException
119            */
120            @Override
121            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
122                    throws PortalException;
123    
124            public DynamicQuery dynamicQuery();
125    
126            /**
127            * Performs a dynamic query on the database and returns the matching rows.
128            *
129            * @param dynamicQuery the dynamic query
130            * @return the matching rows
131            */
132            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
133    
134            /**
135            * Performs a dynamic query on the database and returns a range of the matching rows.
136            *
137            * <p>
138            * 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.MBDiscussionModelImpl}. 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @return the range of matching rows
145            */
146            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
147                    int end);
148    
149            /**
150            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
151            *
152            * <p>
153            * 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.MBDiscussionModelImpl}. 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.
154            * </p>
155            *
156            * @param dynamicQuery the dynamic query
157            * @param start the lower bound of the range of model instances
158            * @param end the upper bound of the range of model instances (not inclusive)
159            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
160            * @return the ordered range of matching rows
161            */
162            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
163                    int end, OrderByComparator<T> orderByComparator);
164    
165            /**
166            * Returns the number of rows matching the dynamic query.
167            *
168            * @param dynamicQuery the dynamic query
169            * @return the number of rows matching the dynamic query
170            */
171            public long dynamicQueryCount(DynamicQuery dynamicQuery);
172    
173            /**
174            * Returns the number of rows matching the dynamic query.
175            *
176            * @param dynamicQuery the dynamic query
177            * @param projection the projection to apply to the query
178            * @return the number of rows matching the dynamic query
179            */
180            public long dynamicQueryCount(DynamicQuery dynamicQuery,
181                    Projection projection);
182    
183            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184            public MBDiscussion fetchDiscussion(java.lang.String className, long classPK);
185    
186            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
187            public MBDiscussion fetchDiscussion(long discussionId);
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public MBDiscussion fetchMBDiscussion(long discussionId);
191    
192            /**
193            * Returns the message boards discussion matching the UUID and group.
194            *
195            * @param uuid the message boards discussion's UUID
196            * @param groupId the primary key of the group
197            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
198            */
199            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200            public MBDiscussion fetchMBDiscussionByUuidAndGroupId(
201                    java.lang.String uuid, long groupId);
202    
203            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204            public MBDiscussion fetchThreadDiscussion(long threadId);
205    
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public ActionableDynamicQuery getActionableDynamicQuery();
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public MBDiscussion getDiscussion(java.lang.String className, long classPK)
211                    throws PortalException;
212    
213            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214            public MBDiscussion getDiscussion(long discussionId)
215                    throws PortalException;
216    
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
219                    PortletDataContext portletDataContext);
220    
221            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
222            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
223    
224            /**
225            * Returns the message boards discussion with the primary key.
226            *
227            * @param discussionId the primary key of the message boards discussion
228            * @return the message boards discussion
229            * @throws PortalException if a message boards discussion with the primary key could not be found
230            */
231            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232            public MBDiscussion getMBDiscussion(long discussionId)
233                    throws PortalException;
234    
235            /**
236            * Returns the message boards discussion matching the UUID and group.
237            *
238            * @param uuid the message boards discussion's UUID
239            * @param groupId the primary key of the group
240            * @return the matching message boards discussion
241            * @throws PortalException if a matching message boards discussion could not be found
242            */
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public MBDiscussion getMBDiscussionByUuidAndGroupId(java.lang.String uuid,
245                    long groupId) throws PortalException;
246    
247            /**
248            * Returns a range of all the message boards discussions.
249            *
250            * <p>
251            * 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.MBDiscussionModelImpl}. 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.
252            * </p>
253            *
254            * @param start the lower bound of the range of message boards discussions
255            * @param end the upper bound of the range of message boards discussions (not inclusive)
256            * @return the range of message boards discussions
257            */
258            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
259            public List<MBDiscussion> getMBDiscussions(int start, int end);
260    
261            /**
262            * Returns all the message boards discussions matching the UUID and company.
263            *
264            * @param uuid the UUID of the message boards discussions
265            * @param companyId the primary key of the company
266            * @return the matching message boards discussions, or an empty list if no matches were found
267            */
268            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
269            public List<MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
270                    java.lang.String uuid, long companyId);
271    
272            /**
273            * Returns a range of message boards discussions matching the UUID and company.
274            *
275            * @param uuid the UUID of the message boards discussions
276            * @param companyId the primary key of the company
277            * @param start the lower bound of the range of message boards discussions
278            * @param end the upper bound of the range of message boards discussions (not inclusive)
279            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
280            * @return the range of matching message boards discussions, or an empty list if no matches were found
281            */
282            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
283            public List<MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
284                    java.lang.String uuid, long companyId, int start, int end,
285                    OrderByComparator<MBDiscussion> orderByComparator);
286    
287            /**
288            * Returns the number of message boards discussions.
289            *
290            * @return the number of message boards discussions
291            */
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public int getMBDiscussionsCount();
294    
295            /**
296            * Returns the OSGi service identifier.
297            *
298            * @return the OSGi service identifier
299            */
300            public java.lang.String getOSGiServiceIdentifier();
301    
302            @Override
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
305                    throws PortalException;
306    
307            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
308            public MBDiscussion getThreadDiscussion(long threadId)
309                    throws PortalException;
310    
311            public void subscribeDiscussion(long userId, long groupId,
312                    java.lang.String className, long classPK) throws PortalException;
313    
314            public void unsubscribeDiscussion(long userId, java.lang.String className,
315                    long classPK) throws PortalException;
316    
317            /**
318            * Updates the message boards discussion in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
319            *
320            * @param mbDiscussion the message boards discussion
321            * @return the message boards discussion that was updated
322            */
323            @Indexable(type = IndexableType.REINDEX)
324            public MBDiscussion updateMBDiscussion(MBDiscussion mbDiscussion);
325    }