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