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