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            /**
254            * Returns the message boards discussion with the primary key.
255            *
256            * @param discussionId the primary key of the message boards discussion
257            * @return the message boards discussion
258            * @throws PortalException if a message boards discussion with the primary key could not be found
259            */
260            public static com.liferay.portlet.messageboards.model.MBDiscussion getMBDiscussion(
261                    long discussionId)
262                    throws com.liferay.portal.kernel.exception.PortalException {
263                    return getService().getMBDiscussion(discussionId);
264            }
265    
266            /**
267            * Returns the message boards discussion matching the UUID and group.
268            *
269            * @param uuid the message boards discussion's UUID
270            * @param groupId the primary key of the group
271            * @return the matching message boards discussion
272            * @throws PortalException if a matching message boards discussion could not be found
273            */
274            public static com.liferay.portlet.messageboards.model.MBDiscussion getMBDiscussionByUuidAndGroupId(
275                    java.lang.String uuid, long groupId)
276                    throws com.liferay.portal.kernel.exception.PortalException {
277                    return getService().getMBDiscussionByUuidAndGroupId(uuid, groupId);
278            }
279    
280            /**
281            * Returns a range of all the message boards discussions.
282            *
283            * <p>
284            * 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.
285            * </p>
286            *
287            * @param start the lower bound of the range of message boards discussions
288            * @param end the upper bound of the range of message boards discussions (not inclusive)
289            * @return the range of message boards discussions
290            */
291            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussions(
292                    int start, int end) {
293                    return getService().getMBDiscussions(start, end);
294            }
295    
296            /**
297            * Returns all the message boards discussions matching the UUID and company.
298            *
299            * @param uuid the UUID of the message boards discussions
300            * @param companyId the primary key of the company
301            * @return the matching message boards discussions, or an empty list if no matches were found
302            */
303            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
304                    java.lang.String uuid, long companyId) {
305                    return getService().getMBDiscussionsByUuidAndCompanyId(uuid, companyId);
306            }
307    
308            /**
309            * Returns a range of message boards discussions matching the UUID and company.
310            *
311            * @param uuid the UUID of the message boards discussions
312            * @param companyId the primary key of the company
313            * @param start the lower bound of the range of message boards discussions
314            * @param end the upper bound of the range of message boards discussions (not inclusive)
315            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
316            * @return the range of matching message boards discussions, or an empty list if no matches were found
317            */
318            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId(
319                    java.lang.String uuid, long companyId, int start, int end,
320                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.messageboards.model.MBDiscussion> orderByComparator) {
321                    return getService()
322                                       .getMBDiscussionsByUuidAndCompanyId(uuid, companyId, start,
323                            end, orderByComparator);
324            }
325    
326            /**
327            * Returns the number of message boards discussions.
328            *
329            * @return the number of message boards discussions
330            */
331            public static int getMBDiscussionsCount() {
332                    return getService().getMBDiscussionsCount();
333            }
334    
335            /**
336            * Returns the OSGi service identifier.
337            *
338            * @return the OSGi service identifier
339            */
340            public static java.lang.String getOSGiServiceIdentifier() {
341                    return getService().getOSGiServiceIdentifier();
342            }
343    
344            public static com.liferay.portal.model.PersistedModel getPersistedModel(
345                    java.io.Serializable primaryKeyObj)
346                    throws com.liferay.portal.kernel.exception.PortalException {
347                    return getService().getPersistedModel(primaryKeyObj);
348            }
349    
350            public static com.liferay.portlet.messageboards.model.MBDiscussion getThreadDiscussion(
351                    long threadId)
352                    throws com.liferay.portal.kernel.exception.PortalException {
353                    return getService().getThreadDiscussion(threadId);
354            }
355    
356            public static void subscribeDiscussion(long userId, long groupId,
357                    java.lang.String className, long classPK)
358                    throws com.liferay.portal.kernel.exception.PortalException {
359                    getService().subscribeDiscussion(userId, groupId, className, classPK);
360            }
361    
362            public static void unsubscribeDiscussion(long userId,
363                    java.lang.String className, long classPK)
364                    throws com.liferay.portal.kernel.exception.PortalException {
365                    getService().unsubscribeDiscussion(userId, className, classPK);
366            }
367    
368            /**
369            * Updates the message boards discussion in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
370            *
371            * @param mbDiscussion the message boards discussion
372            * @return the message boards discussion that was updated
373            */
374            public static com.liferay.portlet.messageboards.model.MBDiscussion updateMBDiscussion(
375                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
376                    return getService().updateMBDiscussion(mbDiscussion);
377            }
378    
379            public static MBDiscussionLocalService getService() {
380                    if (_service == null) {
381                            _service = (MBDiscussionLocalService)PortalBeanLocatorUtil.locate(MBDiscussionLocalService.class.getName());
382    
383                            ReferenceRegistry.registerReference(MBDiscussionLocalServiceUtil.class,
384                                    "_service");
385                    }
386    
387                    return _service;
388            }
389    
390            /**
391             * @deprecated As of 6.2.0
392             */
393            @Deprecated
394            public void setService(MBDiscussionLocalService service) {
395            }
396    
397            private static MBDiscussionLocalService _service;
398    }