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.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for MBDiscussion. This utility wraps
024     * {@link com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see MBDiscussionLocalService
032     * @see com.liferay.portlet.messageboards.service.base.MBDiscussionLocalServiceBaseImpl
033     * @see com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class MBDiscussionLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * @deprecated As of 7.0.0, replaced by {@link #addDiscussion(long, long,
046            long, long, long, ServiceContext)}
047            */
048            @Deprecated
049            public static com.liferay.portlet.messageboards.model.MBDiscussion addDiscussion(
050                    long userId, long classNameId, long classPK, long threadId,
051                    com.liferay.portal.service.ServiceContext serviceContext)
052                    throws com.liferay.portal.kernel.exception.PortalException {
053                    return getService()
054                                       .addDiscussion(userId, classNameId, classPK, threadId,
055                            serviceContext);
056            }
057    
058            public static com.liferay.portlet.messageboards.model.MBDiscussion addDiscussion(
059                    long userId, long groupId, long classNameId, long classPK,
060                    long threadId, com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException {
062                    return getService()
063                                       .addDiscussion(userId, groupId, classNameId, classPK,
064                            threadId, serviceContext);
065            }
066    
067            /**
068            * Adds the message boards discussion to the database. Also notifies the appropriate model listeners.
069            *
070            * @param mbDiscussion the message boards discussion
071            * @return the message boards discussion that was added
072            */
073            public static com.liferay.portlet.messageboards.model.MBDiscussion addMBDiscussion(
074                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
075                    return getService().addMBDiscussion(mbDiscussion);
076            }
077    
078            /**
079            * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database.
080            *
081            * @param discussionId the primary key for the new message boards discussion
082            * @return the new message boards discussion
083            */
084            public static com.liferay.portlet.messageboards.model.MBDiscussion createMBDiscussion(
085                    long discussionId) {
086                    return getService().createMBDiscussion(discussionId);
087            }
088    
089            /**
090            * Deletes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners.
091            *
092            * @param discussionId the primary key of the message boards discussion
093            * @return the message boards discussion that was removed
094            * @throws PortalException if a message boards discussion with the primary key could not be found
095            */
096            public static com.liferay.portlet.messageboards.model.MBDiscussion deleteMBDiscussion(
097                    long discussionId)
098                    throws com.liferay.portal.kernel.exception.PortalException {
099                    return getService().deleteMBDiscussion(discussionId);
100            }
101    
102            /**
103            * Deletes the message boards discussion from the database. Also notifies the appropriate model listeners.
104            *
105            * @param mbDiscussion the message boards discussion
106            * @return the message boards discussion that was removed
107            */
108            public static com.liferay.portlet.messageboards.model.MBDiscussion deleteMBDiscussion(
109                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
110                    return getService().deleteMBDiscussion(mbDiscussion);
111            }
112    
113            /**
114            * @throws PortalException
115            */
116            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
117                    com.liferay.portal.model.PersistedModel persistedModel)
118                    throws com.liferay.portal.kernel.exception.PortalException {
119                    return getService().deletePersistedModel(persistedModel);
120            }
121    
122            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
123                    return getService().dynamicQuery();
124            }
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 static <T> java.util.List<T> dynamicQuery(
133                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
134                    return getService().dynamicQuery(dynamicQuery);
135            }
136    
137            /**
138            * Performs a dynamic query on the database and returns a range of the matching rows.
139            *
140            * <p>
141            * 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.
142            * </p>
143            *
144            * @param dynamicQuery the dynamic query
145            * @param start the lower bound of the range of model instances
146            * @param end the upper bound of the range of model instances (not inclusive)
147            * @return the range of matching rows
148            */
149            public static <T> java.util.List<T> dynamicQuery(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
151                    int end) {
152                    return getService().dynamicQuery(dynamicQuery, start, end);
153            }
154    
155            /**
156            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
157            *
158            * <p>
159            * 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.
160            * </p>
161            *
162            * @param dynamicQuery the dynamic query
163            * @param start the lower bound of the range of model instances
164            * @param end the upper bound of the range of model instances (not inclusive)
165            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
166            * @return the ordered range of matching rows
167            */
168            public static <T> java.util.List<T> dynamicQuery(
169                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
170                    int end,
171                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
172                    return getService()
173                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
174            }
175    
176            /**
177            * Returns the number of rows matching the dynamic query.
178            *
179            * @param dynamicQuery the dynamic query
180            * @return the number of rows matching the dynamic query
181            */
182            public static long dynamicQueryCount(
183                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
184                    return getService().dynamicQueryCount(dynamicQuery);
185            }
186    
187            /**
188            * Returns the number of rows matching the dynamic query.
189            *
190            * @param dynamicQuery the dynamic query
191            * @param projection the projection to apply to the query
192            * @return the number of rows matching the dynamic query
193            */
194            public static long dynamicQueryCount(
195                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
196                    com.liferay.portal.kernel.dao.orm.Projection projection) {
197                    return getService().dynamicQueryCount(dynamicQuery, projection);
198            }
199    
200            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchDiscussion(
201                    java.lang.String className, long classPK) {
202                    return getService().fetchDiscussion(className, classPK);
203            }
204    
205            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchDiscussion(
206                    long discussionId) {
207                    return getService().fetchDiscussion(discussionId);
208            }
209    
210            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchMBDiscussion(
211                    long discussionId) {
212                    return getService().fetchMBDiscussion(discussionId);
213            }
214    
215            /**
216            * Returns the message boards discussion matching the UUID and group.
217            *
218            * @param uuid the message boards discussion's UUID
219            * @param groupId the primary key of the group
220            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
221            */
222            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchMBDiscussionByUuidAndGroupId(
223                    java.lang.String uuid, long groupId) {
224                    return getService().fetchMBDiscussionByUuidAndGroupId(uuid, groupId);
225            }
226    
227            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchThreadDiscussion(
228                    long threadId) {
229                    return getService().fetchThreadDiscussion(threadId);
230            }
231    
232            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
233                    return getService().getActionableDynamicQuery();
234            }
235    
236            public static com.liferay.portlet.messageboards.model.MBDiscussion getDiscussion(
237                    java.lang.String className, long classPK)
238                    throws com.liferay.portal.kernel.exception.PortalException {
239                    return getService().getDiscussion(className, classPK);
240            }
241    
242            public static com.liferay.portlet.messageboards.model.MBDiscussion getDiscussion(
243                    long discussionId)
244                    throws com.liferay.portal.kernel.exception.PortalException {
245                    return getService().getDiscussion(discussionId);
246            }
247    
248            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
249                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
250                    return getService().getExportActionableDynamicQuery(portletDataContext);
251            }
252    
253            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
254                    return getService().getIndexableActionableDynamicQuery();
255            }
256    
257            /**
258            * Returns the message boards discussion with the primary key.
259            *
260            * @param discussionId the primary key of the message boards discussion
261            * @return the message boards discussion
262            * @throws PortalException if a message boards discussion with the primary key could not be found
263            */
264            public static com.liferay.portlet.messageboards.model.MBDiscussion getMBDiscussion(
265                    long discussionId)
266                    throws com.liferay.portal.kernel.exception.PortalException {
267                    return getService().getMBDiscussion(discussionId);
268            }
269    
270            /**
271            * Returns the message boards discussion matching the UUID and group.
272            *
273            * @param uuid the message boards discussion's UUID
274            * @param groupId the primary key of the group
275            * @return the matching message boards discussion
276            * @throws PortalException if a matching message boards discussion could not be found
277            */
278            public static com.liferay.portlet.messageboards.model.MBDiscussion getMBDiscussionByUuidAndGroupId(
279                    java.lang.String uuid, long groupId)
280                    throws com.liferay.portal.kernel.exception.PortalException {
281                    return getService().getMBDiscussionByUuidAndGroupId(uuid, groupId);
282            }
283    
284            /**
285            * Returns a range of all the message boards discussions.
286            *
287            * <p>
288            * 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.
289            * </p>
290            *
291            * @param start the lower bound of the range of message boards discussions
292            * @param end the upper bound of the range of message boards discussions (not inclusive)
293            * @return the range of message boards discussions
294            */
295            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussions(
296                    int start, int end) {
297                    return getService().getMBDiscussions(start, end);
298            }
299    
300            /**
301            * Returns all the message boards discussions matching the UUID and company.
302            *
303            * @param uuid the UUID of the message boards discussions
304            * @param companyId the primary key of the company
305            * @return the matching message boards discussions, or an empty list if no matches were found
306            */
307            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
308                    java.lang.String uuid, long companyId) {
309                    return getService().getMBDiscussionsByUuidAndCompanyId(uuid, companyId);
310            }
311    
312            /**
313            * Returns a range of message boards discussions matching the UUID and company.
314            *
315            * @param uuid the UUID of the message boards discussions
316            * @param companyId the primary key of the company
317            * @param start the lower bound of the range of message boards discussions
318            * @param end the upper bound of the range of message boards discussions (not inclusive)
319            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
320            * @return the range of matching message boards discussions, or an empty list if no matches were found
321            */
322            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
323                    java.lang.String uuid, long companyId, int start, int end,
324                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.messageboards.model.MBDiscussion> orderByComparator) {
325                    return getService()
326                                       .getMBDiscussionsByUuidAndCompanyId(uuid, companyId, start,
327                            end, orderByComparator);
328            }
329    
330            /**
331            * Returns the number of message boards discussions.
332            *
333            * @return the number of message boards discussions
334            */
335            public static int getMBDiscussionsCount() {
336                    return getService().getMBDiscussionsCount();
337            }
338    
339            /**
340            * Returns the OSGi service identifier.
341            *
342            * @return the OSGi service identifier
343            */
344            public static java.lang.String getOSGiServiceIdentifier() {
345                    return getService().getOSGiServiceIdentifier();
346            }
347    
348            public static com.liferay.portal.model.PersistedModel getPersistedModel(
349                    java.io.Serializable primaryKeyObj)
350                    throws com.liferay.portal.kernel.exception.PortalException {
351                    return getService().getPersistedModel(primaryKeyObj);
352            }
353    
354            public static com.liferay.portlet.messageboards.model.MBDiscussion getThreadDiscussion(
355                    long threadId)
356                    throws com.liferay.portal.kernel.exception.PortalException {
357                    return getService().getThreadDiscussion(threadId);
358            }
359    
360            public static void subscribeDiscussion(long userId, long groupId,
361                    java.lang.String className, long classPK)
362                    throws com.liferay.portal.kernel.exception.PortalException {
363                    getService().subscribeDiscussion(userId, groupId, className, classPK);
364            }
365    
366            public static void unsubscribeDiscussion(long userId,
367                    java.lang.String className, long classPK)
368                    throws com.liferay.portal.kernel.exception.PortalException {
369                    getService().unsubscribeDiscussion(userId, className, classPK);
370            }
371    
372            /**
373            * Updates the message boards discussion in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
374            *
375            * @param mbDiscussion the message boards discussion
376            * @return the message boards discussion that was updated
377            */
378            public static com.liferay.portlet.messageboards.model.MBDiscussion updateMBDiscussion(
379                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
380                    return getService().updateMBDiscussion(mbDiscussion);
381            }
382    
383            public static MBDiscussionLocalService getService() {
384                    if (_service == null) {
385                            _service = (MBDiscussionLocalService)PortalBeanLocatorUtil.locate(MBDiscussionLocalService.class.getName());
386    
387                            ReferenceRegistry.registerReference(MBDiscussionLocalServiceUtil.class,
388                                    "_service");
389                    }
390    
391                    return _service;
392            }
393    
394            private static MBDiscussionLocalService _service;
395    }