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