001    /**
002     * Copyright (c) 2000-2013 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.social.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 SocialActivityCounter. This utility wraps
024     * {@link com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl} 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 SocialActivityCounterLocalService
032     * @see com.liferay.portlet.social.service.base.SocialActivityCounterLocalServiceBaseImpl
033     * @see com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class SocialActivityCounterLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the social activity counter to the database. Also notifies the appropriate model listeners.
046            *
047            * @param socialActivityCounter the social activity counter
048            * @return the social activity counter that was added
049            * @throws SystemException if a system exception occurred
050            */
051            public static com.liferay.portlet.social.model.SocialActivityCounter addSocialActivityCounter(
052                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter)
053                    throws com.liferay.portal.kernel.exception.SystemException {
054                    return getService().addSocialActivityCounter(socialActivityCounter);
055            }
056    
057            /**
058            * Creates a new social activity counter with the primary key. Does not add the social activity counter to the database.
059            *
060            * @param activityCounterId the primary key for the new social activity counter
061            * @return the new social activity counter
062            */
063            public static com.liferay.portlet.social.model.SocialActivityCounter createSocialActivityCounter(
064                    long activityCounterId) {
065                    return getService().createSocialActivityCounter(activityCounterId);
066            }
067    
068            /**
069            * Deletes the social activity counter with the primary key from the database. Also notifies the appropriate model listeners.
070            *
071            * @param activityCounterId the primary key of the social activity counter
072            * @return the social activity counter that was removed
073            * @throws PortalException if a social activity counter with the primary key could not be found
074            * @throws SystemException if a system exception occurred
075            */
076            public static com.liferay.portlet.social.model.SocialActivityCounter deleteSocialActivityCounter(
077                    long activityCounterId)
078                    throws com.liferay.portal.kernel.exception.PortalException,
079                            com.liferay.portal.kernel.exception.SystemException {
080                    return getService().deleteSocialActivityCounter(activityCounterId);
081            }
082    
083            /**
084            * Deletes the social activity counter from the database. Also notifies the appropriate model listeners.
085            *
086            * @param socialActivityCounter the social activity counter
087            * @return the social activity counter that was removed
088            * @throws SystemException if a system exception occurred
089            */
090            public static com.liferay.portlet.social.model.SocialActivityCounter deleteSocialActivityCounter(
091                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter)
092                    throws com.liferay.portal.kernel.exception.SystemException {
093                    return getService().deleteSocialActivityCounter(socialActivityCounter);
094            }
095    
096            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
097                    return getService().dynamicQuery();
098            }
099    
100            /**
101            * Performs a dynamic query on the database and returns the matching rows.
102            *
103            * @param dynamicQuery the dynamic query
104            * @return the matching rows
105            * @throws SystemException if a system exception occurred
106            */
107            @SuppressWarnings("rawtypes")
108            public static java.util.List dynamicQuery(
109                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
110                    throws com.liferay.portal.kernel.exception.SystemException {
111                    return getService().dynamicQuery(dynamicQuery);
112            }
113    
114            /**
115            * Performs a dynamic query on the database and returns a range of the matching rows.
116            *
117            * <p>
118            * 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.social.model.impl.SocialActivityCounterModelImpl}. 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.
119            * </p>
120            *
121            * @param dynamicQuery the dynamic query
122            * @param start the lower bound of the range of model instances
123            * @param end the upper bound of the range of model instances (not inclusive)
124            * @return the range of matching rows
125            * @throws SystemException if a system exception occurred
126            */
127            @SuppressWarnings("rawtypes")
128            public static java.util.List dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
130                    int end) throws com.liferay.portal.kernel.exception.SystemException {
131                    return getService().dynamicQuery(dynamicQuery, start, end);
132            }
133    
134            /**
135            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
136            *
137            * <p>
138            * 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.social.model.impl.SocialActivityCounterModelImpl}. 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
145            * @return the ordered range of matching rows
146            * @throws SystemException if a system exception occurred
147            */
148            @SuppressWarnings("rawtypes")
149            public static java.util.List dynamicQuery(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
151                    int end,
152                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return getService()
155                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
156            }
157    
158            /**
159            * Returns the number of rows that match the dynamic query.
160            *
161            * @param dynamicQuery the dynamic query
162            * @return the number of rows that match the dynamic query
163            * @throws SystemException if a system exception occurred
164            */
165            public static long dynamicQueryCount(
166                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167                    throws com.liferay.portal.kernel.exception.SystemException {
168                    return getService().dynamicQueryCount(dynamicQuery);
169            }
170    
171            /**
172            * Returns the number of rows that match the dynamic query.
173            *
174            * @param dynamicQuery the dynamic query
175            * @param projection the projection to apply to the query
176            * @return the number of rows that match the dynamic query
177            * @throws SystemException if a system exception occurred
178            */
179            public static long dynamicQueryCount(
180                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
181                    com.liferay.portal.kernel.dao.orm.Projection projection)
182                    throws com.liferay.portal.kernel.exception.SystemException {
183                    return getService().dynamicQueryCount(dynamicQuery, projection);
184            }
185    
186            public static com.liferay.portlet.social.model.SocialActivityCounter fetchSocialActivityCounter(
187                    long activityCounterId)
188                    throws com.liferay.portal.kernel.exception.SystemException {
189                    return getService().fetchSocialActivityCounter(activityCounterId);
190            }
191    
192            /**
193            * Returns the social activity counter with the primary key.
194            *
195            * @param activityCounterId the primary key of the social activity counter
196            * @return the social activity counter
197            * @throws PortalException if a social activity counter with the primary key could not be found
198            * @throws SystemException if a system exception occurred
199            */
200            public static com.liferay.portlet.social.model.SocialActivityCounter getSocialActivityCounter(
201                    long activityCounterId)
202                    throws com.liferay.portal.kernel.exception.PortalException,
203                            com.liferay.portal.kernel.exception.SystemException {
204                    return getService().getSocialActivityCounter(activityCounterId);
205            }
206    
207            public static com.liferay.portal.model.PersistedModel getPersistedModel(
208                    java.io.Serializable primaryKeyObj)
209                    throws com.liferay.portal.kernel.exception.PortalException,
210                            com.liferay.portal.kernel.exception.SystemException {
211                    return getService().getPersistedModel(primaryKeyObj);
212            }
213    
214            /**
215            * Returns a range of all the social activity counters.
216            *
217            * <p>
218            * 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.social.model.impl.SocialActivityCounterModelImpl}. 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.
219            * </p>
220            *
221            * @param start the lower bound of the range of social activity counters
222            * @param end the upper bound of the range of social activity counters (not inclusive)
223            * @return the range of social activity counters
224            * @throws SystemException if a system exception occurred
225            */
226            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getSocialActivityCounters(
227                    int start, int end)
228                    throws com.liferay.portal.kernel.exception.SystemException {
229                    return getService().getSocialActivityCounters(start, end);
230            }
231    
232            /**
233            * Returns the number of social activity counters.
234            *
235            * @return the number of social activity counters
236            * @throws SystemException if a system exception occurred
237            */
238            public static int getSocialActivityCountersCount()
239                    throws com.liferay.portal.kernel.exception.SystemException {
240                    return getService().getSocialActivityCountersCount();
241            }
242    
243            /**
244            * Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
245            *
246            * @param socialActivityCounter the social activity counter
247            * @return the social activity counter that was updated
248            * @throws SystemException if a system exception occurred
249            */
250            public static com.liferay.portlet.social.model.SocialActivityCounter updateSocialActivityCounter(
251                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter)
252                    throws com.liferay.portal.kernel.exception.SystemException {
253                    return getService().updateSocialActivityCounter(socialActivityCounter);
254            }
255    
256            /**
257            * Returns the Spring bean ID for this bean.
258            *
259            * @return the Spring bean ID for this bean
260            */
261            public static java.lang.String getBeanIdentifier() {
262                    return getService().getBeanIdentifier();
263            }
264    
265            /**
266            * Sets the Spring bean ID for this bean.
267            *
268            * @param beanIdentifier the Spring bean ID for this bean
269            */
270            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
271                    getService().setBeanIdentifier(beanIdentifier);
272            }
273    
274            /**
275            * Adds an activity counter with a default period length.
276            *
277            * <p>
278            * This method uses the lock service to guard against multiple threads
279            * trying to insert the same counter because this service is called
280            * asynchronously from the social activity service.
281            * </p>
282            *
283            * @param groupId the primary key of the group
284            * @param classNameId the primary key of the entity's class this
285            counter belongs to
286            * @param classPK the primary key of the entity this counter belongs to
287            * @param name the counter's name
288            * @param ownerType the counter's owner type. Acceptable values are
289            <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and
290            <code>TYPE_CREATOR</code> defined in {@link
291            com.liferay.portlet.social.model.SocialActivityCounterConstants}.
292            * @param currentValue the counter's current value (optionally
293            <code>0</code>)
294            * @param totalValue the counter's total value (optionally
295            <code>0</code>)
296            * @param startPeriod the counter's start period
297            * @param endPeriod the counter's end period
298            * @return the added activity counter
299            * @throws PortalException if the group or the previous activity counter
300            could not be found
301            * @throws SystemException if a system exception occurred
302            * @deprecated As of 6.2.0, replaced by {@link #addActivityCounter(long,
303            long, long, String, int, int, long, int)}
304            */
305            public static com.liferay.portlet.social.model.SocialActivityCounter addActivityCounter(
306                    long groupId, long classNameId, long classPK, java.lang.String name,
307                    int ownerType, int currentValue, int totalValue, int startPeriod,
308                    int endPeriod)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    return getService()
312                                       .addActivityCounter(groupId, classNameId, classPK, name,
313                            ownerType, currentValue, totalValue, startPeriod, endPeriod);
314            }
315    
316            /**
317            * Adds an activity counter specifying a previous activity and period
318            * length.
319            *
320            * <p>
321            * This method uses the lock service to guard against multiple threads
322            * trying to insert the same counter because this service is called
323            * asynchronously from the social activity service.
324            * </p>
325            *
326            * @param groupId the primary key of the group
327            * @param classNameId the primary key of the entity's class this
328            counter belongs to
329            * @param classPK the primary key of the entity this counter belongs to
330            * @param name the counter name
331            * @param ownerType the counter's owner type. Acceptable values are
332            <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and
333            <code>TYPE_CREATOR</code> defined in {@link
334            com.liferay.portlet.social.model.SocialActivityCounterConstants}.
335            * @param currentValue the current value of the counter (optionally
336            <code>0</code>)
337            * @param totalValue the counter's total value (optionally
338            <code>0</code>)
339            * @param startPeriod the counter's start period
340            * @param endPeriod the counter's end period
341            * @param previousActivityCounterId the primary key of the activity
342            counter for the previous time period (optionally
343            <code>0</code>, if this is the first)
344            * @param periodLength the period length in days,
345            <code>PERIOD_LENGTH_INFINITE</code> for never ending counters
346            or <code>PERIOD_LENGTH_SYSTEM</code> for the period length
347            defined in <code>portal-ext.properties</code>. For more
348            information see {@link
349            com.liferay.portlet.social.model.SocialActivityCounterConstants}.
350            * @return the added activity counter
351            * @throws PortalException if the group or the previous activity counter
352            could not be found
353            * @throws SystemException if a system exception occurred
354            * @deprecated As of 6.2.0, replaced by {@link #addActivityCounter(long,
355            long, long, String, int, int, long, int)}
356            */
357            public static com.liferay.portlet.social.model.SocialActivityCounter addActivityCounter(
358                    long groupId, long classNameId, long classPK, java.lang.String name,
359                    int ownerType, int currentValue, int totalValue, int startPeriod,
360                    int endPeriod, long previousActivityCounterId, int periodLength)
361                    throws com.liferay.portal.kernel.exception.PortalException,
362                            com.liferay.portal.kernel.exception.SystemException {
363                    return getService()
364                                       .addActivityCounter(groupId, classNameId, classPK, name,
365                            ownerType, currentValue, totalValue, startPeriod, endPeriod,
366                            previousActivityCounterId, periodLength);
367            }
368    
369            /**
370            * Adds an activity counter specifying a previous activity and period
371            * length.
372            *
373            * <p>
374            * This method uses the lock service to guard against multiple threads
375            * trying to insert the same counter because this service is called
376            * asynchronously from the social activity service.
377            * </p>
378            *
379            * @param groupId the primary key of the group
380            * @param classNameId the primary key of the entity's class this counter
381            belongs to
382            * @param classPK the primary key of the entity this counter belongs to
383            * @param name the counter name
384            * @param ownerType the counter's owner type. Acceptable values are
385            <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and
386            <code>TYPE_CREATOR</code> defined in {@link
387            com.liferay.portlet.social.model.SocialActivityCounterConstants}.
388            * @param totalValue the counter's total value (optionally <code>0</code>)
389            * @param previousActivityCounterId the primary key of the activity counter
390            for the previous time period (optionally <code>0</code>, if this
391            is the first)
392            * @param periodLength the period length in days,
393            <code>PERIOD_LENGTH_INFINITE</code> for never ending counters or
394            <code>PERIOD_LENGTH_SYSTEM</code> for the period length defined
395            in <code>portal-ext.properties</code>. For more information see
396            {@link
397            com.liferay.portlet.social.model.SocialActivityCounterConstants}.
398            * @return the added activity counter
399            * @throws PortalException if the group or the previous activity counter
400            could not be found
401            * @throws SystemException if a system exception occurred
402            */
403            public static com.liferay.portlet.social.model.SocialActivityCounter addActivityCounter(
404                    long groupId, long classNameId, long classPK, java.lang.String name,
405                    int ownerType, int totalValue, long previousActivityCounterId,
406                    int periodLength)
407                    throws com.liferay.portal.kernel.exception.PortalException,
408                            com.liferay.portal.kernel.exception.SystemException {
409                    return getService()
410                                       .addActivityCounter(groupId, classNameId, classPK, name,
411                            ownerType, totalValue, previousActivityCounterId, periodLength);
412            }
413    
414            /**
415            * Adds or increments activity counters related to an activity.
416            *
417            * </p>
418            * This method is called asynchronously from the social activity service
419            * when the user performs an activity defined in
420            * </code>liferay-social.xml</code>.
421            * </p>
422            *
423            * <p>
424            * This method first calls the activity processor class, if there is one
425            * defined for the activity, checks for limits and increments all the
426            * counters that belong to the activity. Afterwards, it processes the
427            * activity with respect to achievement classes, if any. Lastly it
428            * increments the built-in <code>user.activities</code> and
429            * <code>asset.activities</code> counters.
430            * </p>
431            *
432            * @param activity the social activity
433            * @throws PortalException if an expected group or expected previous
434            activity counters could not be found
435            * @throws SystemException if a system exception occurred
436            */
437            public static void addActivityCounters(
438                    com.liferay.portlet.social.model.SocialActivity activity)
439                    throws com.liferay.portal.kernel.exception.PortalException,
440                            com.liferay.portal.kernel.exception.SystemException {
441                    getService().addActivityCounters(activity);
442            }
443    
444            /**
445            * Creates an activity counter with a default period length, adding it into
446            * the database.
447            *
448            * @param groupId the primary key of the group
449            * @param classNameId the primary key of the entity's class this
450            counter belongs to
451            * @param classPK the primary key of the entity this counter belongs to
452            * @param name the counter's name
453            * @param ownerType the counter's owner type. Acceptable values are
454            <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and
455            <code>TYPE_CREATOR</code> defined in {@link
456            com.liferay.portlet.social.model.SocialActivityCounterConstants}.
457            * @param currentValue the counter's current value (optionally
458            <code>0</code>)
459            * @param totalValue the counter's total value (optionally
460            <code>0</code>)
461            * @param startPeriod the counter's start period
462            * @param endPeriod the counter's end period
463            * @return the created activity counter
464            * @throws PortalException if the group or a previous activity counter
465            could not be found
466            * @throws SystemException if a system exception occurred
467            * @deprecated As of 6.2.0, replaced by {@link #addActivityCounter(long,
468            long, long, String, int, int, long, int)}
469            */
470            public static com.liferay.portlet.social.model.SocialActivityCounter createActivityCounter(
471                    long groupId, long classNameId, long classPK, java.lang.String name,
472                    int ownerType, int currentValue, int totalValue, int startPeriod,
473                    int endPeriod)
474                    throws com.liferay.portal.kernel.exception.PortalException,
475                            com.liferay.portal.kernel.exception.SystemException {
476                    return getService()
477                                       .createActivityCounter(groupId, classNameId, classPK, name,
478                            ownerType, currentValue, totalValue, startPeriod, endPeriod);
479            }
480    
481            /**
482            * Creates an activity counter, adding it into the database.
483            *
484            * <p>
485            * This method actually creates the counter in the database. It requires a
486            * new transaction so that other threads can find the new counter when the
487            * lock in the calling method is released.
488            * </p>
489            *
490            * @param groupId the primary key of the group
491            * @param classNameId the primary key of the entity's class this
492            counter belongs to
493            * @param classPK the primary key of the entity this counter belongs to
494            * @param name the counter's name
495            * @param ownerType the counter's owner type. Acceptable values are
496            <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and
497            <code>TYPE_CREATOR</code> defined in {@link
498            com.liferay.portlet.social.model.SocialActivityCounterConstants}.
499            * @param currentValue the counter's current value (optionally
500            <code>0</code>)
501            * @param totalValue the counter's total value of the counter
502            (optionally <code>0</code>)
503            * @param startPeriod the counter's start period
504            * @param endPeriod the counter's end period
505            * @param previousActivityCounterId the primary key of the activity
506            counter for the previous time period (optionally
507            <code>0</code>, if this is the first)
508            * @param periodLength the period length in days,
509            <code>PERIOD_LENGTH_INFINITE</code> for never ending counters
510            or <code>PERIOD_LENGTH_SYSTEM</code> for the period length
511            defined in <code>portal-ext.properties</code>. For more
512            information see {@link
513            com.liferay.portlet.social.model.SocialActivityConstants}.
514            * @return the created activity counter
515            * @throws PortalException if the group or the previous activity counter
516            could not be found
517            * @throws SystemException if a system exception occurred
518            * @deprecated As of 6.2.0, replaced by {@link #addActivityCounter(long,
519            long, long, String, int, int, long, int)}
520            */
521            public static com.liferay.portlet.social.model.SocialActivityCounter createActivityCounter(
522                    long groupId, long classNameId, long classPK, java.lang.String name,
523                    int ownerType, int currentValue, int totalValue, int startPeriod,
524                    int endPeriod, long previousActivityCounterId, int periodLength)
525                    throws com.liferay.portal.kernel.exception.PortalException,
526                            com.liferay.portal.kernel.exception.SystemException {
527                    return getService()
528                                       .createActivityCounter(groupId, classNameId, classPK, name,
529                            ownerType, currentValue, totalValue, startPeriod, endPeriod,
530                            previousActivityCounterId, periodLength);
531            }
532    
533            /**
534            * Deletes all activity counters, limits, and settings related to the asset.
535            *
536            * <p>
537            * This method subtracts the asset's popularity from the owner's
538            * contribution points. It also creates a new contribution period if the
539            * latest one does not belong to the current period.
540            * </p>
541            *
542            * @param assetEntry the asset entry
543            * @throws PortalException if the new contribution counter could not be
544            created
545            * @throws SystemException if a system exception occurred
546            */
547            public static void deleteActivityCounters(
548                    com.liferay.portlet.asset.model.AssetEntry assetEntry)
549                    throws com.liferay.portal.kernel.exception.PortalException,
550                            com.liferay.portal.kernel.exception.SystemException {
551                    getService().deleteActivityCounters(assetEntry);
552            }
553    
554            /**
555            * Deletes all activity counters, limits, and settings related to the entity
556            * identified by the class name ID and class primary key.
557            *
558            * @param classNameId the primary key of the entity's class
559            * @param classPK the primary key of the entity
560            * @throws PortalException if the entity is an asset and its owner's
561            contribution counter could not be updated
562            * @throws SystemException if a system exception occurred
563            */
564            public static void deleteActivityCounters(long classNameId, long classPK)
565                    throws com.liferay.portal.kernel.exception.PortalException,
566                            com.liferay.portal.kernel.exception.SystemException {
567                    getService().deleteActivityCounters(classNameId, classPK);
568            }
569    
570            /**
571            * Deletes all activity counters for the entity identified by the class name
572            * and class primary key.
573            *
574            * @param className the entity's class name
575            * @param classPK the primary key of the entity
576            * @throws PortalException if the entity is an asset and its owner's
577            contribution counter could not be updated
578            * @throws SystemException if a system exception occurred
579            */
580            public static void deleteActivityCounters(java.lang.String className,
581                    long classPK)
582                    throws com.liferay.portal.kernel.exception.PortalException,
583                            com.liferay.portal.kernel.exception.SystemException {
584                    getService().deleteActivityCounters(className, classPK);
585            }
586    
587            /**
588            * Disables all the counters of an asset identified by the class name ID and
589            * class primary key.
590            *
591            * <p>
592            * This method is used by the recycle bin to disable all counters of assets
593            * put into the recycle bin. It adjusts the owner's contribution score.
594            * </p>
595            *
596            * @param classNameId the primary key of the asset's class
597            * @param classPK the primary key of the asset
598            * @throws PortalException if the asset owner's contribution counter could
599            not be updated
600            * @throws SystemException if a system exception occurred
601            */
602            public static void disableActivityCounters(long classNameId, long classPK)
603                    throws com.liferay.portal.kernel.exception.PortalException,
604                            com.liferay.portal.kernel.exception.SystemException {
605                    getService().disableActivityCounters(classNameId, classPK);
606            }
607    
608            /**
609            * Disables all the counters of an asset identified by the class name and
610            * class primary key.
611            *
612            * <p>
613            * This method is used by the recycle bin to disable all counters of assets
614            * put into the recycle bin. It adjusts the owner's contribution score.
615            * </p>
616            *
617            * @param className the asset's class name
618            * @param classPK the primary key of the asset
619            * @throws PortalException if the asset owner's contribution counter could
620            not be updated
621            * @throws SystemException if a system exception occurred
622            */
623            public static void disableActivityCounters(java.lang.String className,
624                    long classPK)
625                    throws com.liferay.portal.kernel.exception.PortalException,
626                            com.liferay.portal.kernel.exception.SystemException {
627                    getService().disableActivityCounters(className, classPK);
628            }
629    
630            /**
631            * Enables all activity counters of an asset identified by the class name ID
632            * and class primary key.
633            *
634            * <p>
635            * This method is used by the recycle bin to enable all counters of assets
636            * restored from the recycle bin. It adjusts the owner's contribution score.
637            * </p>
638            *
639            * @param classNameId the primary key of the asset's class
640            * @param classPK the primary key of the asset
641            * @throws PortalException if the asset owner's contribution counter could
642            not be updated
643            * @throws SystemException if a system exception occurred
644            */
645            public static void enableActivityCounters(long classNameId, long classPK)
646                    throws com.liferay.portal.kernel.exception.PortalException,
647                            com.liferay.portal.kernel.exception.SystemException {
648                    getService().enableActivityCounters(classNameId, classPK);
649            }
650    
651            /**
652            * Enables all the counters of an asset identified by the class name and
653            * class primary key.
654            *
655            * <p>
656            * This method is used by the recycle bin to enable all counters of assets
657            * restored from the recycle bin. It adjusts the owner's contribution score.
658            * </p>
659            *
660            * @param className the asset's class name
661            * @param classPK the primary key of the asset
662            * @throws PortalException if the asset owner's contribution counter could
663            not be updated
664            * @throws SystemException if a system exception occurred
665            */
666            public static void enableActivityCounters(java.lang.String className,
667                    long classPK)
668                    throws com.liferay.portal.kernel.exception.PortalException,
669                            com.liferay.portal.kernel.exception.SystemException {
670                    getService().enableActivityCounters(className, classPK);
671            }
672    
673            /**
674            * Returns the activity counter with the given name, owner, and end period
675            * that belong to the given entity.
676            *
677            * @param groupId the primary key of the group
678            * @param classNameId the primary key of the entity's class
679            * @param classPK the primary key of the entity
680            * @param name the counter name
681            * @param ownerType the owner type
682            * @param endPeriod the end period, <code>-1</code> for the latest one
683            * @return the matching activity counter
684            * @throws SystemException if a system exception occurred
685            */
686            public static com.liferay.portlet.social.model.SocialActivityCounter fetchActivityCounterByEndPeriod(
687                    long groupId, long classNameId, long classPK, java.lang.String name,
688                    int ownerType, int endPeriod)
689                    throws com.liferay.portal.kernel.exception.SystemException {
690                    return getService()
691                                       .fetchActivityCounterByEndPeriod(groupId, classNameId,
692                            classPK, name, ownerType, endPeriod);
693            }
694    
695            /**
696            * Returns the activity counter with the given name, owner, and start period
697            * that belong to the given entity.
698            *
699            * @param groupId the primary key of the group
700            * @param classNameId the primary key of the entity's class
701            * @param classPK the primary key of the entity
702            * @param name the counter name
703            * @param ownerType the owner type
704            * @param startPeriod the start period
705            * @return the matching activity counter
706            * @throws SystemException if a system exception occurred
707            */
708            public static com.liferay.portlet.social.model.SocialActivityCounter fetchActivityCounterByStartPeriod(
709                    long groupId, long classNameId, long classPK, java.lang.String name,
710                    int ownerType, int startPeriod)
711                    throws com.liferay.portal.kernel.exception.SystemException {
712                    return getService()
713                                       .fetchActivityCounterByStartPeriod(groupId, classNameId,
714                            classPK, name, ownerType, startPeriod);
715            }
716    
717            /**
718            * Returns the latest activity counter with the given name and owner that
719            * belong to the given entity.
720            *
721            * @param groupId the primary key of the group
722            * @param classNameId the primary key of the entity's class
723            * @param classPK the primary key of the entity
724            * @param name the counter name
725            * @param ownerType the owner type
726            * @return the matching activity counter
727            * @throws SystemException if a system exception occurred
728            */
729            public static com.liferay.portlet.social.model.SocialActivityCounter fetchLatestActivityCounter(
730                    long groupId, long classNameId, long classPK, java.lang.String name,
731                    int ownerType)
732                    throws com.liferay.portal.kernel.exception.SystemException {
733                    return getService()
734                                       .fetchLatestActivityCounter(groupId, classNameId, classPK,
735                            name, ownerType);
736            }
737    
738            /**
739            * Returns all the activity counters with the given name and period offsets.
740            *
741            * <p>
742            * The start and end offsets can belong to different periods. This method
743            * groups the counters by name and returns the sum of their current values.
744            * </p>
745            *
746            * @param groupId the primary key of the group
747            * @param name the counter name
748            * @param startOffset the offset for the start period
749            * @param endOffset the offset for the end period
750            * @return the matching activity counters
751            * @throws SystemException if a system exception occurred
752            */
753            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getOffsetActivityCounters(
754                    long groupId, java.lang.String name, int startOffset, int endOffset)
755                    throws com.liferay.portal.kernel.exception.SystemException {
756                    return getService()
757                                       .getOffsetActivityCounters(groupId, name, startOffset,
758                            endOffset);
759            }
760    
761            /**
762            * Returns the distribution of the activity counters with the given name and
763            * period offsets.
764            *
765            * <p>
766            * The start and end offsets can belong to different periods. This method
767            * groups the counters by their owner entity (usually some asset) and
768            * returns a counter for each entity class with the sum of the counters'
769            * current values.
770            * </p>
771            *
772            * @param groupId the primary key of the group
773            * @param name the counter name
774            * @param startOffset the offset for the start period
775            * @param endOffset the offset for the end period
776            * @return the distribution of matching activity counters
777            * @throws SystemException if a system exception occurred
778            */
779            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getOffsetDistributionActivityCounters(
780                    long groupId, java.lang.String name, int startOffset, int endOffset)
781                    throws com.liferay.portal.kernel.exception.SystemException {
782                    return getService()
783                                       .getOffsetDistributionActivityCounters(groupId, name,
784                            startOffset, endOffset);
785            }
786    
787            /**
788            * Returns all the activity counters with the given name and time period.
789            *
790            * <p>
791            * The start and end period values can belong to different periods. This
792            * method groups the counters by name and returns the sum of their current
793            * values.
794            * </p>
795            *
796            * @param groupId the primary key of the group
797            * @param name the counter name
798            * @param startPeriod the start period
799            * @param endPeriod the end period
800            * @return the matching activity counters
801            * @throws SystemException if a system exception occurred
802            */
803            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getPeriodActivityCounters(
804                    long groupId, java.lang.String name, int startPeriod, int endPeriod)
805                    throws com.liferay.portal.kernel.exception.SystemException {
806                    return getService()
807                                       .getPeriodActivityCounters(groupId, name, startPeriod,
808                            endPeriod);
809            }
810    
811            /**
812            * Returns the distribution of activity counters with the given name and
813            * time period.
814            *
815            * <p>
816            * The start and end period values can belong to different periods. This
817            * method groups the counters by their owner entity (usually some asset) and
818            * returns a counter for each entity class with the sum of the counters'
819            * current values.
820            * </p>
821            *
822            * @param groupId the primary key of the group
823            * @param name the counter name
824            * @param startPeriod the start period
825            * @param endPeriod the end period
826            * @return the distribution of matching activity counters
827            * @throws SystemException if a system exception occurred
828            */
829            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getPeriodDistributionActivityCounters(
830                    long groupId, java.lang.String name, int startPeriod, int endPeriod)
831                    throws com.liferay.portal.kernel.exception.SystemException {
832                    return getService()
833                                       .getPeriodDistributionActivityCounters(groupId, name,
834                            startPeriod, endPeriod);
835            }
836    
837            /**
838            * Returns the range of tuples that contain users and a list of activity
839            * counters.
840            *
841            * <p>
842            * The counters returned for each user are passed to this method in the
843            * selectedNames array. The method also accepts an array of counter names
844            * that are used to rank the users.
845            * </p>
846            *
847            * <p>
848            * Useful when paginating results. Returns a maximum of <code>end -
849            * start</code> instances. <code>start</code> and <code>end</code> are not
850            * primary keys, they are indexes in the result set. Thus, <code>0</code>
851            * refers to the first result in the set. Setting both <code>start</code>
852            * and <code>end</code> to {@link
853            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
854            * result set.
855            * </p>
856            *
857            * @param groupId the primary key of the group
858            * @param rankingNames the ranking counter names
859            * @param selectedNames the counter names that will be returned with each
860            user
861            * @param start the lower bound of the range of results
862            * @param end the upper bound of the range of results (not inclusive)
863            * @return the range of matching tuples
864            * @throws SystemException if a system exception occurred
865            */
866            public static java.util.List<com.liferay.portal.kernel.util.Tuple> getUserActivityCounters(
867                    long groupId, java.lang.String[] rankingNames,
868                    java.lang.String[] selectedNames, int start, int end)
869                    throws com.liferay.portal.kernel.exception.SystemException {
870                    return getService()
871                                       .getUserActivityCounters(groupId, rankingNames,
872                            selectedNames, start, end);
873            }
874    
875            /**
876            * Returns the number of users having a rank based on the given counters.
877            *
878            * @param groupId the primary key of the group
879            * @param rankingNames the ranking counter names
880            * @return the number of matching users
881            * @throws SystemException if a system exception occurred
882            */
883            public static int getUserActivityCountersCount(long groupId,
884                    java.lang.String[] rankingNames)
885                    throws com.liferay.portal.kernel.exception.SystemException {
886                    return getService().getUserActivityCountersCount(groupId, rankingNames);
887            }
888    
889            /**
890            * Increments the <code>user.achievements</code> counter for a user.
891            *
892            * <p>
893            * This method should be used by an external achievement class when the
894            * users unlocks an achievement.
895            * </p>
896            *
897            * @param userId the primary key of the user
898            * @param groupId the primary key of the group
899            * @throws PortalException if the group or an expected previous activity
900            counter could not be found
901            * @throws SystemException if a system exception occurred
902            */
903            public static void incrementUserAchievementCounter(long userId, long groupId)
904                    throws com.liferay.portal.kernel.exception.PortalException,
905                            com.liferay.portal.kernel.exception.SystemException {
906                    getService().incrementUserAchievementCounter(userId, groupId);
907            }
908    
909            public static SocialActivityCounterLocalService getService() {
910                    if (_service == null) {
911                            _service = (SocialActivityCounterLocalService)PortalBeanLocatorUtil.locate(SocialActivityCounterLocalService.class.getName());
912    
913                            ReferenceRegistry.registerReference(SocialActivityCounterLocalServiceUtil.class,
914                                    "_service");
915                    }
916    
917                    return _service;
918            }
919    
920            /**
921             * @deprecated As of 6.2.0
922             */
923            public void setService(SocialActivityCounterLocalService service) {
924            }
925    
926            private static SocialActivityCounterLocalService _service;
927    }