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