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.social.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for 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            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
052                    return getService().getIndexableActionableDynamicQuery();
053            }
054    
055            /**
056            * @throws PortalException
057            */
058            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
059                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
060                    throws com.liferay.portal.kernel.exception.PortalException {
061                    return getService().deletePersistedModel(persistedModel);
062            }
063    
064            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
065                    java.io.Serializable primaryKeyObj)
066                    throws com.liferay.portal.kernel.exception.PortalException {
067                    return getService().getPersistedModel(primaryKeyObj);
068            }
069    
070            /**
071            * Adds an activity counter specifying a previous activity and period
072            * length.
073            *
074            * <p>
075            * This method uses the lock service to guard against multiple threads
076            * trying to insert the same counter because this service is called
077            * asynchronously from the social activity service.
078            * </p>
079            *
080            * @param groupId the primary key of the group
081            * @param classNameId the primary key of the entity's class this counter
082            belongs to
083            * @param classPK the primary key of the entity this counter belongs to
084            * @param name the counter name
085            * @param ownerType the counter's owner type. Acceptable values are
086            <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and
087            <code>TYPE_CREATOR</code> defined in {@link
088            SocialActivityCounterConstants}.
089            * @param totalValue the counter's total value (optionally <code>0</code>)
090            * @param previousActivityCounterId the primary key of the activity counter
091            for the previous time period (optionally <code>0</code>, if this
092            is the first)
093            * @param periodLength the period length in days,
094            <code>PERIOD_LENGTH_INFINITE</code> for never ending counters or
095            <code>PERIOD_LENGTH_SYSTEM</code> for the period length defined
096            in <code>portal-ext.properties</code>. For more information see
097            {@link SocialActivityCounterConstants}.
098            * @return the added activity counter
099            */
100            public static com.liferay.social.kernel.model.SocialActivityCounter addActivityCounter(
101                    long groupId, long classNameId, long classPK, java.lang.String name,
102                    int ownerType, int totalValue, long previousActivityCounterId,
103                    int periodLength)
104                    throws com.liferay.portal.kernel.exception.PortalException {
105                    return getService()
106                                       .addActivityCounter(groupId, classNameId, classPK, name,
107                            ownerType, totalValue, previousActivityCounterId, periodLength);
108            }
109    
110            /**
111            * Adds the social activity counter to the database. Also notifies the appropriate model listeners.
112            *
113            * @param socialActivityCounter the social activity counter
114            * @return the social activity counter that was added
115            */
116            public static com.liferay.social.kernel.model.SocialActivityCounter addSocialActivityCounter(
117                    com.liferay.social.kernel.model.SocialActivityCounter socialActivityCounter) {
118                    return getService().addSocialActivityCounter(socialActivityCounter);
119            }
120    
121            /**
122            * Creates a new social activity counter with the primary key. Does not add the social activity counter to the database.
123            *
124            * @param activityCounterId the primary key for the new social activity counter
125            * @return the new social activity counter
126            */
127            public static com.liferay.social.kernel.model.SocialActivityCounter createSocialActivityCounter(
128                    long activityCounterId) {
129                    return getService().createSocialActivityCounter(activityCounterId);
130            }
131    
132            /**
133            * Deletes the social activity counter from the database. Also notifies the appropriate model listeners.
134            *
135            * @param socialActivityCounter the social activity counter
136            * @return the social activity counter that was removed
137            */
138            public static com.liferay.social.kernel.model.SocialActivityCounter deleteSocialActivityCounter(
139                    com.liferay.social.kernel.model.SocialActivityCounter socialActivityCounter) {
140                    return getService().deleteSocialActivityCounter(socialActivityCounter);
141            }
142    
143            /**
144            * Deletes the social activity counter with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param activityCounterId the primary key of the social activity counter
147            * @return the social activity counter that was removed
148            * @throws PortalException if a social activity counter with the primary key could not be found
149            */
150            public static com.liferay.social.kernel.model.SocialActivityCounter deleteSocialActivityCounter(
151                    long activityCounterId)
152                    throws com.liferay.portal.kernel.exception.PortalException {
153                    return getService().deleteSocialActivityCounter(activityCounterId);
154            }
155    
156            /**
157            * Returns the activity counter with the given name, owner, and end period
158            * that belong to the given entity.
159            *
160            * @param groupId the primary key of the group
161            * @param classNameId the primary key of the entity's class
162            * @param classPK the primary key of the entity
163            * @param name the counter name
164            * @param ownerType the owner type
165            * @param endPeriod the end period, <code>-1</code> for the latest one
166            * @return the matching activity counter
167            */
168            public static com.liferay.social.kernel.model.SocialActivityCounter fetchActivityCounterByEndPeriod(
169                    long groupId, long classNameId, long classPK, java.lang.String name,
170                    int ownerType, int endPeriod) {
171                    return getService()
172                                       .fetchActivityCounterByEndPeriod(groupId, classNameId,
173                            classPK, name, ownerType, endPeriod);
174            }
175    
176            /**
177            * Returns the activity counter with the given name, owner, and start period
178            * that belong to the given entity.
179            *
180            * @param groupId the primary key of the group
181            * @param classNameId the primary key of the entity's class
182            * @param classPK the primary key of the entity
183            * @param name the counter name
184            * @param ownerType the owner type
185            * @param startPeriod the start period
186            * @return the matching activity counter
187            */
188            public static com.liferay.social.kernel.model.SocialActivityCounter fetchActivityCounterByStartPeriod(
189                    long groupId, long classNameId, long classPK, java.lang.String name,
190                    int ownerType, int startPeriod) {
191                    return getService()
192                                       .fetchActivityCounterByStartPeriod(groupId, classNameId,
193                            classPK, name, ownerType, startPeriod);
194            }
195    
196            /**
197            * Returns the latest activity counter with the given name and owner that
198            * belong to the given entity.
199            *
200            * @param groupId the primary key of the group
201            * @param classNameId the primary key of the entity's class
202            * @param classPK the primary key of the entity
203            * @param name the counter name
204            * @param ownerType the owner type
205            * @return the matching activity counter
206            */
207            public static com.liferay.social.kernel.model.SocialActivityCounter fetchLatestActivityCounter(
208                    long groupId, long classNameId, long classPK, java.lang.String name,
209                    int ownerType) {
210                    return getService()
211                                       .fetchLatestActivityCounter(groupId, classNameId, classPK,
212                            name, ownerType);
213            }
214    
215            public static com.liferay.social.kernel.model.SocialActivityCounter fetchSocialActivityCounter(
216                    long activityCounterId) {
217                    return getService().fetchSocialActivityCounter(activityCounterId);
218            }
219    
220            /**
221            * Returns the social activity counter with the primary key.
222            *
223            * @param activityCounterId the primary key of the social activity counter
224            * @return the social activity counter
225            * @throws PortalException if a social activity counter with the primary key could not be found
226            */
227            public static com.liferay.social.kernel.model.SocialActivityCounter getSocialActivityCounter(
228                    long activityCounterId)
229                    throws com.liferay.portal.kernel.exception.PortalException {
230                    return getService().getSocialActivityCounter(activityCounterId);
231            }
232    
233            /**
234            * Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
235            *
236            * @param socialActivityCounter the social activity counter
237            * @return the social activity counter that was updated
238            */
239            public static com.liferay.social.kernel.model.SocialActivityCounter updateSocialActivityCounter(
240                    com.liferay.social.kernel.model.SocialActivityCounter socialActivityCounter) {
241                    return getService().updateSocialActivityCounter(socialActivityCounter);
242            }
243    
244            /**
245            * Returns the number of social activity counters.
246            *
247            * @return the number of social activity counters
248            */
249            public static int getSocialActivityCountersCount() {
250                    return getService().getSocialActivityCountersCount();
251            }
252    
253            /**
254            * Returns the number of users having a rank based on the given counters.
255            *
256            * @param groupId the primary key of the group
257            * @param rankingNames the ranking counter names
258            * @return the number of matching users
259            */
260            public static int getUserActivityCountersCount(long groupId,
261                    java.lang.String[] rankingNames) {
262                    return getService().getUserActivityCountersCount(groupId, rankingNames);
263            }
264    
265            /**
266            * Returns the OSGi service identifier.
267            *
268            * @return the OSGi service identifier
269            */
270            public static java.lang.String getOSGiServiceIdentifier() {
271                    return getService().getOSGiServiceIdentifier();
272            }
273    
274            /**
275            * Performs a dynamic query on the database and returns the matching rows.
276            *
277            * @param dynamicQuery the dynamic query
278            * @return the matching rows
279            */
280            public static <T> java.util.List<T> dynamicQuery(
281                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
282                    return getService().dynamicQuery(dynamicQuery);
283            }
284    
285            /**
286            * Performs a dynamic query on the database and returns a range of the matching rows.
287            *
288            * <p>
289            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.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.
290            * </p>
291            *
292            * @param dynamicQuery the dynamic query
293            * @param start the lower bound of the range of model instances
294            * @param end the upper bound of the range of model instances (not inclusive)
295            * @return the range of matching rows
296            */
297            public static <T> java.util.List<T> dynamicQuery(
298                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
299                    int end) {
300                    return getService().dynamicQuery(dynamicQuery, start, end);
301            }
302    
303            /**
304            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
305            *
306            * <p>
307            * 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.
308            * </p>
309            *
310            * @param dynamicQuery the dynamic query
311            * @param start the lower bound of the range of model instances
312            * @param end the upper bound of the range of model instances (not inclusive)
313            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
314            * @return the ordered range of matching rows
315            */
316            public static <T> java.util.List<T> dynamicQuery(
317                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
318                    int end,
319                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
320                    return getService()
321                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
322            }
323    
324            /**
325            * Returns all the activity counters with the given name and period offsets.
326            *
327            * <p>
328            * The start and end offsets can belong to different periods. This method
329            * groups the counters by name and returns the sum of their current values.
330            * </p>
331            *
332            * @param groupId the primary key of the group
333            * @param name the counter name
334            * @param startOffset the offset for the start period
335            * @param endOffset the offset for the end period
336            * @return the matching activity counters
337            */
338            public static java.util.List<com.liferay.social.kernel.model.SocialActivityCounter> getOffsetActivityCounters(
339                    long groupId, java.lang.String name, int startOffset, int endOffset) {
340                    return getService()
341                                       .getOffsetActivityCounters(groupId, name, startOffset,
342                            endOffset);
343            }
344    
345            /**
346            * Returns the distribution of the activity counters with the given name and
347            * period offsets.
348            *
349            * <p>
350            * The start and end offsets can belong to different periods. This method
351            * groups the counters by their owner entity (usually some asset) and
352            * returns a counter for each entity class with the sum of the counters'
353            * current values.
354            * </p>
355            *
356            * @param groupId the primary key of the group
357            * @param name the counter name
358            * @param startOffset the offset for the start period
359            * @param endOffset the offset for the end period
360            * @return the distribution of matching activity counters
361            */
362            public static java.util.List<com.liferay.social.kernel.model.SocialActivityCounter> getOffsetDistributionActivityCounters(
363                    long groupId, java.lang.String name, int startOffset, int endOffset) {
364                    return getService()
365                                       .getOffsetDistributionActivityCounters(groupId, name,
366                            startOffset, endOffset);
367            }
368    
369            /**
370            * Returns all the activity counters with the given name and time period.
371            *
372            * <p>
373            * The start and end period values can belong to different periods. This
374            * method groups the counters by name and returns the sum of their current
375            * values.
376            * </p>
377            *
378            * @param groupId the primary key of the group
379            * @param name the counter name
380            * @param startPeriod the start period
381            * @param endPeriod the end period
382            * @return the matching activity counters
383            */
384            public static java.util.List<com.liferay.social.kernel.model.SocialActivityCounter> getPeriodActivityCounters(
385                    long groupId, java.lang.String name, int startPeriod, int endPeriod) {
386                    return getService()
387                                       .getPeriodActivityCounters(groupId, name, startPeriod,
388                            endPeriod);
389            }
390    
391            /**
392            * Returns the distribution of activity counters with the given name and
393            * time period.
394            *
395            * <p>
396            * The start and end period values can belong to different periods. This
397            * method groups the counters by their owner entity (usually some asset) and
398            * returns a counter for each entity class with the sum of the counters'
399            * current values.
400            * </p>
401            *
402            * @param groupId the primary key of the group
403            * @param name the counter name
404            * @param startPeriod the start period
405            * @param endPeriod the end period
406            * @return the distribution of matching activity counters
407            */
408            public static java.util.List<com.liferay.social.kernel.model.SocialActivityCounter> getPeriodDistributionActivityCounters(
409                    long groupId, java.lang.String name, int startPeriod, int endPeriod) {
410                    return getService()
411                                       .getPeriodDistributionActivityCounters(groupId, name,
412                            startPeriod, endPeriod);
413            }
414    
415            /**
416            * Returns a range of all the social activity counters.
417            *
418            * <p>
419            * 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.
420            * </p>
421            *
422            * @param start the lower bound of the range of social activity counters
423            * @param end the upper bound of the range of social activity counters (not inclusive)
424            * @return the range of social activity counters
425            */
426            public static java.util.List<com.liferay.social.kernel.model.SocialActivityCounter> getSocialActivityCounters(
427                    int start, int end) {
428                    return getService().getSocialActivityCounters(start, end);
429            }
430    
431            /**
432            * Returns the range of tuples that contain users and a list of activity
433            * counters.
434            *
435            * <p>
436            * The counters returned for each user are passed to this method in the
437            * selectedNames array. The method also accepts an array of counter names
438            * that are used to rank the users.
439            * </p>
440            *
441            * <p>
442            * Useful when paginating results. Returns a maximum of <code>end -
443            * start</code> instances. <code>start</code> and <code>end</code> are not
444            * primary keys, they are indexes in the result set. Thus, <code>0</code>
445            * refers to the first result in the set. Setting both <code>start</code>
446            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
447            * result set.
448            * </p>
449            *
450            * @param groupId the primary key of the group
451            * @param rankingNames the ranking counter names
452            * @param selectedNames the counter names that will be returned with each
453            user
454            * @param start the lower bound of the range of results
455            * @param end the upper bound of the range of results (not inclusive)
456            * @return the range of matching tuples
457            */
458            public static java.util.List<com.liferay.portal.kernel.util.Tuple> getUserActivityCounters(
459                    long groupId, java.lang.String[] rankingNames,
460                    java.lang.String[] selectedNames, int start, int end) {
461                    return getService()
462                                       .getUserActivityCounters(groupId, rankingNames,
463                            selectedNames, start, end);
464            }
465    
466            /**
467            * Returns the number of rows matching the dynamic query.
468            *
469            * @param dynamicQuery the dynamic query
470            * @return the number of rows matching the dynamic query
471            */
472            public static long dynamicQueryCount(
473                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
474                    return getService().dynamicQueryCount(dynamicQuery);
475            }
476    
477            /**
478            * Returns the number of rows matching the dynamic query.
479            *
480            * @param dynamicQuery the dynamic query
481            * @param projection the projection to apply to the query
482            * @return the number of rows matching the dynamic query
483            */
484            public static long dynamicQueryCount(
485                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
486                    com.liferay.portal.kernel.dao.orm.Projection projection) {
487                    return getService().dynamicQueryCount(dynamicQuery, projection);
488            }
489    
490            /**
491            * Adds or increments activity counters related to an activity.
492            *
493            * </p>
494            * This method is called asynchronously from the social activity service
495            * when the user performs an activity defined in
496            * </code>liferay-social.xml</code>.
497            * </p>
498            *
499            * <p>
500            * This method first calls the activity processor class, if there is one
501            * defined for the activity, checks for limits and increments all the
502            * counters that belong to the activity. Afterwards, it processes the
503            * activity with respect to achievement classes, if any. Lastly it
504            * increments the built-in <code>user.activities</code> and
505            * <code>asset.activities</code> counters.
506            * </p>
507            *
508            * @param activity the social activity
509            */
510            public static void addActivityCounters(
511                    com.liferay.social.kernel.model.SocialActivity activity)
512                    throws com.liferay.portal.kernel.exception.PortalException {
513                    getService().addActivityCounters(activity);
514            }
515    
516            /**
517            * Deletes all activity counters, limits, and settings related to the asset.
518            *
519            * <p>
520            * This method subtracts the asset's popularity from the owner's
521            * contribution points. It also creates a new contribution period if the
522            * latest one does not belong to the current period.
523            * </p>
524            *
525            * @param assetEntry the asset entry
526            */
527            public static void deleteActivityCounters(
528                    com.liferay.asset.kernel.model.AssetEntry assetEntry)
529                    throws com.liferay.portal.kernel.exception.PortalException {
530                    getService().deleteActivityCounters(assetEntry);
531            }
532    
533            /**
534            * Deletes all activity counters for the entity identified by the class name
535            * and class primary key.
536            *
537            * @param className the entity's class name
538            * @param classPK the primary key of the entity
539            */
540            public static void deleteActivityCounters(java.lang.String className,
541                    long classPK)
542                    throws com.liferay.portal.kernel.exception.PortalException {
543                    getService().deleteActivityCounters(className, classPK);
544            }
545    
546            /**
547            * Deletes all activity counters, limits, and settings related to the entity
548            * identified by the class name ID and class primary key.
549            *
550            * @param classNameId the primary key of the entity's class
551            * @param classPK the primary key of the entity
552            */
553            public static void deleteActivityCounters(long classNameId, long classPK)
554                    throws com.liferay.portal.kernel.exception.PortalException {
555                    getService().deleteActivityCounters(classNameId, classPK);
556            }
557    
558            /**
559            * Disables all the counters of an asset identified by the class name and
560            * class primary key.
561            *
562            * <p>
563            * This method is used by the recycle bin to disable all counters of assets
564            * put into the recycle bin. It adjusts the owner's contribution score.
565            * </p>
566            *
567            * @param className the asset's class name
568            * @param classPK the primary key of the asset
569            */
570            public static void disableActivityCounters(java.lang.String className,
571                    long classPK)
572                    throws com.liferay.portal.kernel.exception.PortalException {
573                    getService().disableActivityCounters(className, classPK);
574            }
575    
576            /**
577            * Disables all the counters of an asset identified by the class name ID and
578            * class primary key.
579            *
580            * <p>
581            * This method is used by the recycle bin to disable all counters of assets
582            * put into the recycle bin. It adjusts the owner's contribution score.
583            * </p>
584            *
585            * @param classNameId the primary key of the asset's class
586            * @param classPK the primary key of the asset
587            */
588            public static void disableActivityCounters(long classNameId, long classPK)
589                    throws com.liferay.portal.kernel.exception.PortalException {
590                    getService().disableActivityCounters(classNameId, classPK);
591            }
592    
593            /**
594            * Enables all the counters of an asset identified by the class name and
595            * class primary key.
596            *
597            * <p>
598            * This method is used by the recycle bin to enable all counters of assets
599            * restored from the recycle bin. It adjusts the owner's contribution score.
600            * </p>
601            *
602            * @param className the asset's class name
603            * @param classPK the primary key of the asset
604            */
605            public static void enableActivityCounters(java.lang.String className,
606                    long classPK)
607                    throws com.liferay.portal.kernel.exception.PortalException {
608                    getService().enableActivityCounters(className, classPK);
609            }
610    
611            /**
612            * Enables all activity counters of an asset identified by the class name ID
613            * and class primary key.
614            *
615            * <p>
616            * This method is used by the recycle bin to enable all counters of assets
617            * restored from the recycle bin. It adjusts the owner's contribution score.
618            * </p>
619            *
620            * @param classNameId the primary key of the asset's class
621            * @param classPK the primary key of the asset
622            */
623            public static void enableActivityCounters(long classNameId, long classPK)
624                    throws com.liferay.portal.kernel.exception.PortalException {
625                    getService().enableActivityCounters(classNameId, classPK);
626            }
627    
628            /**
629            * Increments the <code>user.achievements</code> counter for a user.
630            *
631            * <p>
632            * This method should be used by an external achievement class when the
633            * users unlocks an achievement.
634            * </p>
635            *
636            * @param userId the primary key of the user
637            * @param groupId the primary key of the group
638            */
639            public static void incrementUserAchievementCounter(long userId, long groupId)
640                    throws com.liferay.portal.kernel.exception.PortalException {
641                    getService().incrementUserAchievementCounter(userId, groupId);
642            }
643    
644            public static SocialActivityCounterLocalService getService() {
645                    if (_service == null) {
646                            _service = (SocialActivityCounterLocalService)PortalBeanLocatorUtil.locate(SocialActivityCounterLocalService.class.getName());
647    
648                            ReferenceRegistry.registerReference(SocialActivityCounterLocalServiceUtil.class,
649                                    "_service");
650                    }
651    
652                    return _service;
653            }
654    
655            private static SocialActivityCounterLocalService _service;
656    }