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            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public com.liferay.portlet.messageboards.model.MBDiscussion getDiscussion(
211                    java.lang.String className, long classPK) throws PortalException;
212    
213            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214            public com.liferay.portlet.messageboards.model.MBDiscussion getDiscussion(
215                    long discussionId) throws PortalException;
216    
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
219                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext);
220    
221            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
222            public com.liferay.portal.kernel.dao.orm.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 com.liferay.portlet.messageboards.model.MBDiscussion getMBDiscussion(
233                    long discussionId) 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 com.liferay.portlet.messageboards.model.MBDiscussion getMBDiscussionByUuidAndGroupId(
245                    java.lang.String uuid, 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 java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussions(
260                    int start, int end);
261    
262            /**
263            * Returns all the message boards discussions matching the UUID and company.
264            *
265            * @param uuid the UUID of the message boards discussions
266            * @param companyId the primary key of the company
267            * @return the matching message boards discussions, or an empty list if no matches were found
268            */
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
271                    java.lang.String uuid, long companyId);
272    
273            /**
274            * Returns a range of message boards discussions matching the UUID and company.
275            *
276            * @param uuid the UUID of the message boards discussions
277            * @param companyId the primary key of the company
278            * @param start the lower bound of the range of message boards discussions
279            * @param end the upper bound of the range of message boards discussions (not inclusive)
280            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
281            * @return the range of matching message boards discussions, or an empty list if no matches were found
282            */
283            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
284            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
285                    java.lang.String uuid, long companyId, int start, int end,
286                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.messageboards.model.MBDiscussion> orderByComparator);
287    
288            /**
289            * Returns the number of message boards discussions.
290            *
291            * @return the number of message boards discussions
292            */
293            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
294            public int getMBDiscussionsCount();
295    
296            /**
297            * Returns the OSGi service identifier.
298            *
299            * @return the OSGi service identifier
300            */
301            public java.lang.String getOSGiServiceIdentifier();
302    
303            @Override
304            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
305            public com.liferay.portal.model.PersistedModel getPersistedModel(
306                    java.io.Serializable primaryKeyObj) throws PortalException;
307    
308            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
309            public com.liferay.portlet.messageboards.model.MBDiscussion getThreadDiscussion(
310                    long threadId) throws PortalException;
311    
312            public void subscribeDiscussion(long userId, long groupId,
313                    java.lang.String className, long classPK) throws PortalException;
314    
315            public void unsubscribeDiscussion(long userId, java.lang.String className,
316                    long classPK) throws PortalException;
317    
318            /**
319            * Updates the message boards discussion in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
320            *
321            * @param mbDiscussion the message boards discussion
322            * @return the message boards discussion that was updated
323            */
324            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
325            public com.liferay.portlet.messageboards.model.MBDiscussion updateMBDiscussion(
326                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion);
327    }