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