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 MBBan. This utility wraps
024     * {@link com.liferay.portlet.messageboards.service.impl.MBBanLocalServiceImpl} 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 MBBanLocalService
032     * @see com.liferay.portlet.messageboards.service.base.MBBanLocalServiceBaseImpl
033     * @see com.liferay.portlet.messageboards.service.impl.MBBanLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class MBBanLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBBanLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static boolean hasBan(long groupId, long banUserId) {
044                    return getService().hasBan(groupId, banUserId);
045            }
046    
047            public static com.liferay.message.boards.kernel.model.MBBan addBan(
048                    long userId, long banUserId,
049                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
050                    throws com.liferay.portal.kernel.exception.PortalException {
051                    return getService().addBan(userId, banUserId, serviceContext);
052            }
053    
054            /**
055            * Adds the message boards ban to the database. Also notifies the appropriate model listeners.
056            *
057            * @param mbBan the message boards ban
058            * @return the message boards ban that was added
059            */
060            public static com.liferay.message.boards.kernel.model.MBBan addMBBan(
061                    com.liferay.message.boards.kernel.model.MBBan mbBan) {
062                    return getService().addMBBan(mbBan);
063            }
064    
065            /**
066            * Creates a new message boards ban with the primary key. Does not add the message boards ban to the database.
067            *
068            * @param banId the primary key for the new message boards ban
069            * @return the new message boards ban
070            */
071            public static com.liferay.message.boards.kernel.model.MBBan createMBBan(
072                    long banId) {
073                    return getService().createMBBan(banId);
074            }
075    
076            /**
077            * Deletes the message boards ban from the database. Also notifies the appropriate model listeners.
078            *
079            * @param mbBan the message boards ban
080            * @return the message boards ban that was removed
081            */
082            public static com.liferay.message.boards.kernel.model.MBBan deleteMBBan(
083                    com.liferay.message.boards.kernel.model.MBBan mbBan) {
084                    return getService().deleteMBBan(mbBan);
085            }
086    
087            /**
088            * Deletes the message boards ban with the primary key from the database. Also notifies the appropriate model listeners.
089            *
090            * @param banId the primary key of the message boards ban
091            * @return the message boards ban that was removed
092            * @throws PortalException if a message boards ban with the primary key could not be found
093            */
094            public static com.liferay.message.boards.kernel.model.MBBan deleteMBBan(
095                    long banId) throws com.liferay.portal.kernel.exception.PortalException {
096                    return getService().deleteMBBan(banId);
097            }
098    
099            public static com.liferay.message.boards.kernel.model.MBBan fetchMBBan(
100                    long banId) {
101                    return getService().fetchMBBan(banId);
102            }
103    
104            /**
105            * Returns the message boards ban matching the UUID and group.
106            *
107            * @param uuid the message boards ban's UUID
108            * @param groupId the primary key of the group
109            * @return the matching message boards ban, or <code>null</code> if a matching message boards ban could not be found
110            */
111            public static com.liferay.message.boards.kernel.model.MBBan fetchMBBanByUuidAndGroupId(
112                    java.lang.String uuid, long groupId) {
113                    return getService().fetchMBBanByUuidAndGroupId(uuid, groupId);
114            }
115    
116            /**
117            * Returns the message boards ban with the primary key.
118            *
119            * @param banId the primary key of the message boards ban
120            * @return the message boards ban
121            * @throws PortalException if a message boards ban with the primary key could not be found
122            */
123            public static com.liferay.message.boards.kernel.model.MBBan getMBBan(
124                    long banId) throws com.liferay.portal.kernel.exception.PortalException {
125                    return getService().getMBBan(banId);
126            }
127    
128            /**
129            * Returns the message boards ban matching the UUID and group.
130            *
131            * @param uuid the message boards ban's UUID
132            * @param groupId the primary key of the group
133            * @return the matching message boards ban
134            * @throws PortalException if a matching message boards ban could not be found
135            */
136            public static com.liferay.message.boards.kernel.model.MBBan getMBBanByUuidAndGroupId(
137                    java.lang.String uuid, long groupId)
138                    throws com.liferay.portal.kernel.exception.PortalException {
139                    return getService().getMBBanByUuidAndGroupId(uuid, groupId);
140            }
141    
142            /**
143            * Updates the message boards ban in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
144            *
145            * @param mbBan the message boards ban
146            * @return the message boards ban that was updated
147            */
148            public static com.liferay.message.boards.kernel.model.MBBan updateMBBan(
149                    com.liferay.message.boards.kernel.model.MBBan mbBan) {
150                    return getService().updateMBBan(mbBan);
151            }
152    
153            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
154                    return getService().getActionableDynamicQuery();
155            }
156    
157            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
158                    return getService().dynamicQuery();
159            }
160    
161            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
162                    com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) {
163                    return getService().getExportActionableDynamicQuery(portletDataContext);
164            }
165    
166            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
167                    return getService().getIndexableActionableDynamicQuery();
168            }
169    
170            /**
171            * @throws PortalException
172            */
173            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
174                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
175                    throws com.liferay.portal.kernel.exception.PortalException {
176                    return getService().deletePersistedModel(persistedModel);
177            }
178    
179            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
180                    java.io.Serializable primaryKeyObj)
181                    throws com.liferay.portal.kernel.exception.PortalException {
182                    return getService().getPersistedModel(primaryKeyObj);
183            }
184    
185            public static int getBansCount(long groupId) {
186                    return getService().getBansCount(groupId);
187            }
188    
189            /**
190            * Returns the number of message boards bans.
191            *
192            * @return the number of message boards bans
193            */
194            public static int getMBBansCount() {
195                    return getService().getMBBansCount();
196            }
197    
198            /**
199            * Returns the OSGi service identifier.
200            *
201            * @return the OSGi service identifier
202            */
203            public static java.lang.String getOSGiServiceIdentifier() {
204                    return getService().getOSGiServiceIdentifier();
205            }
206    
207            /**
208            * Performs a dynamic query on the database and returns the matching rows.
209            *
210            * @param dynamicQuery the dynamic query
211            * @return the matching rows
212            */
213            public static <T> java.util.List<T> dynamicQuery(
214                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
215                    return getService().dynamicQuery(dynamicQuery);
216            }
217    
218            /**
219            * Performs a dynamic query on the database and returns a range of the matching rows.
220            *
221            * <p>
222            * 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.MBBanModelImpl}. 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.
223            * </p>
224            *
225            * @param dynamicQuery the dynamic query
226            * @param start the lower bound of the range of model instances
227            * @param end the upper bound of the range of model instances (not inclusive)
228            * @return the range of matching rows
229            */
230            public static <T> java.util.List<T> dynamicQuery(
231                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
232                    int end) {
233                    return getService().dynamicQuery(dynamicQuery, start, end);
234            }
235    
236            /**
237            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
238            *
239            * <p>
240            * 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.MBBanModelImpl}. 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.
241            * </p>
242            *
243            * @param dynamicQuery the dynamic query
244            * @param start the lower bound of the range of model instances
245            * @param end the upper bound of the range of model instances (not inclusive)
246            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
247            * @return the ordered range of matching rows
248            */
249            public static <T> java.util.List<T> dynamicQuery(
250                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
251                    int end,
252                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
253                    return getService()
254                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
255            }
256    
257            public static java.util.List<com.liferay.message.boards.kernel.model.MBBan> getBans(
258                    long groupId, int start, int end) {
259                    return getService().getBans(groupId, start, end);
260            }
261    
262            /**
263            * Returns a range of all the message boards bans.
264            *
265            * <p>
266            * 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.MBBanModelImpl}. 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.
267            * </p>
268            *
269            * @param start the lower bound of the range of message boards bans
270            * @param end the upper bound of the range of message boards bans (not inclusive)
271            * @return the range of message boards bans
272            */
273            public static java.util.List<com.liferay.message.boards.kernel.model.MBBan> getMBBans(
274                    int start, int end) {
275                    return getService().getMBBans(start, end);
276            }
277    
278            /**
279            * Returns all the message boards bans matching the UUID and company.
280            *
281            * @param uuid the UUID of the message boards bans
282            * @param companyId the primary key of the company
283            * @return the matching message boards bans, or an empty list if no matches were found
284            */
285            public static java.util.List<com.liferay.message.boards.kernel.model.MBBan> getMBBansByUuidAndCompanyId(
286                    java.lang.String uuid, long companyId) {
287                    return getService().getMBBansByUuidAndCompanyId(uuid, companyId);
288            }
289    
290            /**
291            * Returns a range of message boards bans matching the UUID and company.
292            *
293            * @param uuid the UUID of the message boards bans
294            * @param companyId the primary key of the company
295            * @param start the lower bound of the range of message boards bans
296            * @param end the upper bound of the range of message boards bans (not inclusive)
297            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
298            * @return the range of matching message boards bans, or an empty list if no matches were found
299            */
300            public static java.util.List<com.liferay.message.boards.kernel.model.MBBan> getMBBansByUuidAndCompanyId(
301                    java.lang.String uuid, long companyId, int start, int end,
302                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.message.boards.kernel.model.MBBan> orderByComparator) {
303                    return getService()
304                                       .getMBBansByUuidAndCompanyId(uuid, companyId, start, end,
305                            orderByComparator);
306            }
307    
308            /**
309            * Returns the number of rows matching the dynamic query.
310            *
311            * @param dynamicQuery the dynamic query
312            * @return the number of rows matching the dynamic query
313            */
314            public static long dynamicQueryCount(
315                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
316                    return getService().dynamicQueryCount(dynamicQuery);
317            }
318    
319            /**
320            * Returns the number of rows matching the dynamic query.
321            *
322            * @param dynamicQuery the dynamic query
323            * @param projection the projection to apply to the query
324            * @return the number of rows matching the dynamic query
325            */
326            public static long dynamicQueryCount(
327                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
328                    com.liferay.portal.kernel.dao.orm.Projection projection) {
329                    return getService().dynamicQueryCount(dynamicQuery, projection);
330            }
331    
332            public static void checkBan(long groupId, long banUserId)
333                    throws com.liferay.portal.kernel.exception.PortalException {
334                    getService().checkBan(groupId, banUserId);
335            }
336    
337            public static void deleteBan(
338                    com.liferay.message.boards.kernel.model.MBBan ban) {
339                    getService().deleteBan(ban);
340            }
341    
342            public static void deleteBan(long banId)
343                    throws com.liferay.portal.kernel.exception.PortalException {
344                    getService().deleteBan(banId);
345            }
346    
347            public static void deleteBan(long banUserId,
348                    com.liferay.portal.kernel.service.ServiceContext serviceContext) {
349                    getService().deleteBan(banUserId, serviceContext);
350            }
351    
352            public static void deleteBansByBanUserId(long banUserId) {
353                    getService().deleteBansByBanUserId(banUserId);
354            }
355    
356            public static void deleteBansByGroupId(long groupId) {
357                    getService().deleteBansByGroupId(groupId);
358            }
359    
360            public static void expireBans() {
361                    getService().expireBans();
362            }
363    
364            public static MBBanLocalService getService() {
365                    if (_service == null) {
366                            _service = (MBBanLocalService)PortalBeanLocatorUtil.locate(MBBanLocalService.class.getName());
367    
368                            ReferenceRegistry.registerReference(MBBanLocalServiceUtil.class,
369                                    "_service");
370                    }
371    
372                    return _service;
373            }
374    
375            private static MBBanLocalService _service;
376    }