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 MBStatsUser. This utility wraps
024     * {@link com.liferay.portlet.messageboards.service.impl.MBStatsUserLocalServiceImpl} 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 MBStatsUserLocalService
032     * @see com.liferay.portlet.messageboards.service.base.MBStatsUserLocalServiceBaseImpl
033     * @see com.liferay.portlet.messageboards.service.impl.MBStatsUserLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class MBStatsUserLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBStatsUserLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the message boards stats user to the database. Also notifies the appropriate model listeners.
046            *
047            * @param mbStatsUser the message boards stats user
048            * @return the message boards stats user that was added
049            */
050            public static com.liferay.message.boards.kernel.model.MBStatsUser addMBStatsUser(
051                    com.liferay.message.boards.kernel.model.MBStatsUser mbStatsUser) {
052                    return getService().addMBStatsUser(mbStatsUser);
053            }
054    
055            public static com.liferay.message.boards.kernel.model.MBStatsUser addStatsUser(
056                    long groupId, long userId) {
057                    return getService().addStatsUser(groupId, userId);
058            }
059    
060            /**
061            * Creates a new message boards stats user with the primary key. Does not add the message boards stats user to the database.
062            *
063            * @param statsUserId the primary key for the new message boards stats user
064            * @return the new message boards stats user
065            */
066            public static com.liferay.message.boards.kernel.model.MBStatsUser createMBStatsUser(
067                    long statsUserId) {
068                    return getService().createMBStatsUser(statsUserId);
069            }
070    
071            /**
072            * Deletes the message boards stats user from the database. Also notifies the appropriate model listeners.
073            *
074            * @param mbStatsUser the message boards stats user
075            * @return the message boards stats user that was removed
076            */
077            public static com.liferay.message.boards.kernel.model.MBStatsUser deleteMBStatsUser(
078                    com.liferay.message.boards.kernel.model.MBStatsUser mbStatsUser) {
079                    return getService().deleteMBStatsUser(mbStatsUser);
080            }
081    
082            /**
083            * Deletes the message boards stats user with the primary key from the database. Also notifies the appropriate model listeners.
084            *
085            * @param statsUserId the primary key of the message boards stats user
086            * @return the message boards stats user that was removed
087            * @throws PortalException if a message boards stats user with the primary key could not be found
088            */
089            public static com.liferay.message.boards.kernel.model.MBStatsUser deleteMBStatsUser(
090                    long statsUserId)
091                    throws com.liferay.portal.kernel.exception.PortalException {
092                    return getService().deleteMBStatsUser(statsUserId);
093            }
094    
095            public static com.liferay.message.boards.kernel.model.MBStatsUser fetchMBStatsUser(
096                    long statsUserId) {
097                    return getService().fetchMBStatsUser(statsUserId);
098            }
099    
100            /**
101            * Returns the message boards stats user with the primary key.
102            *
103            * @param statsUserId the primary key of the message boards stats user
104            * @return the message boards stats user
105            * @throws PortalException if a message boards stats user with the primary key could not be found
106            */
107            public static com.liferay.message.boards.kernel.model.MBStatsUser getMBStatsUser(
108                    long statsUserId)
109                    throws com.liferay.portal.kernel.exception.PortalException {
110                    return getService().getMBStatsUser(statsUserId);
111            }
112    
113            public static com.liferay.message.boards.kernel.model.MBStatsUser getStatsUser(
114                    long groupId, long userId) {
115                    return getService().getStatsUser(groupId, userId);
116            }
117    
118            /**
119            * Updates the message boards stats user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
120            *
121            * @param mbStatsUser the message boards stats user
122            * @return the message boards stats user that was updated
123            */
124            public static com.liferay.message.boards.kernel.model.MBStatsUser updateMBStatsUser(
125                    com.liferay.message.boards.kernel.model.MBStatsUser mbStatsUser) {
126                    return getService().updateMBStatsUser(mbStatsUser);
127            }
128    
129            public static com.liferay.message.boards.kernel.model.MBStatsUser updateStatsUser(
130                    long groupId, long userId) {
131                    return getService().updateStatsUser(groupId, userId);
132            }
133    
134            public static com.liferay.message.boards.kernel.model.MBStatsUser updateStatsUser(
135                    long groupId, long userId, int messageCount, java.util.Date lastPostDate) {
136                    return getService()
137                                       .updateStatsUser(groupId, userId, messageCount, lastPostDate);
138            }
139    
140            public static com.liferay.message.boards.kernel.model.MBStatsUser updateStatsUser(
141                    long groupId, long userId, java.util.Date lastPostDate) {
142                    return getService().updateStatsUser(groupId, userId, lastPostDate);
143            }
144    
145            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
146                    return getService().getActionableDynamicQuery();
147            }
148    
149            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
150                    return getService().dynamicQuery();
151            }
152    
153            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
154                    return getService().getIndexableActionableDynamicQuery();
155            }
156    
157            /**
158            * @throws PortalException
159            */
160            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
161                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
162                    throws com.liferay.portal.kernel.exception.PortalException {
163                    return getService().deletePersistedModel(persistedModel);
164            }
165    
166            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
167                    java.io.Serializable primaryKeyObj)
168                    throws com.liferay.portal.kernel.exception.PortalException {
169                    return getService().getPersistedModel(primaryKeyObj);
170            }
171    
172            /**
173            * Returns the number of message boards stats users.
174            *
175            * @return the number of message boards stats users
176            */
177            public static int getMBStatsUsersCount() {
178                    return getService().getMBStatsUsersCount();
179            }
180    
181            public static int getStatsUsersByGroupIdCount(long groupId)
182                    throws com.liferay.portal.kernel.exception.PortalException {
183                    return getService().getStatsUsersByGroupIdCount(groupId);
184            }
185    
186            /**
187            * Returns the OSGi service identifier.
188            *
189            * @return the OSGi service identifier
190            */
191            public static java.lang.String getOSGiServiceIdentifier() {
192                    return getService().getOSGiServiceIdentifier();
193            }
194    
195            public static java.util.Date getLastPostDateByUserId(long groupId,
196                    long userId) {
197                    return getService().getLastPostDateByUserId(groupId, userId);
198            }
199    
200            /**
201            * Performs a dynamic query on the database and returns the matching rows.
202            *
203            * @param dynamicQuery the dynamic query
204            * @return the matching rows
205            */
206            public static <T> java.util.List<T> dynamicQuery(
207                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
208                    return getService().dynamicQuery(dynamicQuery);
209            }
210    
211            /**
212            * Performs a dynamic query on the database and returns a range of the matching rows.
213            *
214            * <p>
215            * 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.MBStatsUserModelImpl}. 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.
216            * </p>
217            *
218            * @param dynamicQuery the dynamic query
219            * @param start the lower bound of the range of model instances
220            * @param end the upper bound of the range of model instances (not inclusive)
221            * @return the range of matching rows
222            */
223            public static <T> java.util.List<T> dynamicQuery(
224                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
225                    int end) {
226                    return getService().dynamicQuery(dynamicQuery, start, end);
227            }
228    
229            /**
230            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
231            *
232            * <p>
233            * 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.MBStatsUserModelImpl}. 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.
234            * </p>
235            *
236            * @param dynamicQuery the dynamic query
237            * @param start the lower bound of the range of model instances
238            * @param end the upper bound of the range of model instances (not inclusive)
239            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
240            * @return the ordered range of matching rows
241            */
242            public static <T> java.util.List<T> dynamicQuery(
243                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
244                    int end,
245                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
246                    return getService()
247                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
248            }
249    
250            /**
251            * Returns a range of all the message boards stats users.
252            *
253            * <p>
254            * 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.MBStatsUserModelImpl}. 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.
255            * </p>
256            *
257            * @param start the lower bound of the range of message boards stats users
258            * @param end the upper bound of the range of message boards stats users (not inclusive)
259            * @return the range of message boards stats users
260            */
261            public static java.util.List<com.liferay.message.boards.kernel.model.MBStatsUser> getMBStatsUsers(
262                    int start, int end) {
263                    return getService().getMBStatsUsers(start, end);
264            }
265    
266            public static java.util.List<com.liferay.message.boards.kernel.model.MBStatsUser> getStatsUsersByGroupId(
267                    long groupId, int start, int end)
268                    throws com.liferay.portal.kernel.exception.PortalException {
269                    return getService().getStatsUsersByGroupId(groupId, start, end);
270            }
271    
272            public static java.util.List<com.liferay.message.boards.kernel.model.MBStatsUser> getStatsUsersByUserId(
273                    long userId) {
274                    return getService().getStatsUsersByUserId(userId);
275            }
276    
277            /**
278            * Returns the number of rows matching the dynamic query.
279            *
280            * @param dynamicQuery the dynamic query
281            * @return the number of rows matching the dynamic query
282            */
283            public static long dynamicQueryCount(
284                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
285                    return getService().dynamicQueryCount(dynamicQuery);
286            }
287    
288            /**
289            * Returns the number of rows matching the dynamic query.
290            *
291            * @param dynamicQuery the dynamic query
292            * @param projection the projection to apply to the query
293            * @return the number of rows matching the dynamic query
294            */
295            public static long dynamicQueryCount(
296                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
297                    com.liferay.portal.kernel.dao.orm.Projection projection) {
298                    return getService().dynamicQueryCount(dynamicQuery, projection);
299            }
300    
301            public static long getMessageCountByGroupId(long groupId) {
302                    return getService().getMessageCountByGroupId(groupId);
303            }
304    
305            public static long getMessageCountByUserId(long userId) {
306                    return getService().getMessageCountByUserId(userId);
307            }
308    
309            public static void deleteStatsUser(
310                    com.liferay.message.boards.kernel.model.MBStatsUser statsUser) {
311                    getService().deleteStatsUser(statsUser);
312            }
313    
314            public static void deleteStatsUser(long statsUserId)
315                    throws com.liferay.portal.kernel.exception.PortalException {
316                    getService().deleteStatsUser(statsUserId);
317            }
318    
319            public static void deleteStatsUsersByGroupId(long groupId) {
320                    getService().deleteStatsUsersByGroupId(groupId);
321            }
322    
323            public static void deleteStatsUsersByUserId(long userId) {
324                    getService().deleteStatsUsersByUserId(userId);
325            }
326    
327            public static MBStatsUserLocalService getService() {
328                    if (_service == null) {
329                            _service = (MBStatsUserLocalService)PortalBeanLocatorUtil.locate(MBStatsUserLocalService.class.getName());
330    
331                            ReferenceRegistry.registerReference(MBStatsUserLocalServiceUtil.class,
332                                    "_service");
333                    }
334    
335                    return _service;
336            }
337    
338            private static MBStatsUserLocalService _service;
339    }