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