public class SocialActivityCounterLocalServiceWrapper extends Object implements ServiceWrapper<SocialActivityCounterLocalService>, SocialActivityCounterLocalService
SocialActivityCounterLocalService
.SocialActivityCounterLocalService
Constructor and Description |
---|
SocialActivityCounterLocalServiceWrapper() |
SocialActivityCounterLocalServiceWrapper(SocialActivityCounterLocalService socialActivityCounterLocalService) |
Modifier and Type | Method and Description |
---|---|
SocialActivityCounter |
addActivityCounter(long groupId,
long classNameId,
long classPK,
String name,
int ownerType,
int totalValue,
long previousActivityCounterId,
int periodLength)
Adds an activity counter specifying a previous activity and period
length.
|
void |
addActivityCounters(SocialActivity activity)
Adds or increments activity counters related to an activity.
|
SocialActivityCounter |
addSocialActivityCounter(SocialActivityCounter socialActivityCounter)
Adds the social activity counter to the database.
|
PersistedModel |
createPersistedModel(Serializable primaryKeyObj) |
SocialActivityCounter |
createSocialActivityCounter(long activityCounterId)
Creates a new social activity counter with the primary key.
|
void |
deleteActivityCounters(AssetEntry assetEntry)
Deletes all activity counters, limits, and settings related to the asset.
|
void |
deleteActivityCounters(long classNameId,
long classPK)
Deletes all activity counters, limits, and settings related to the entity
identified by the class name ID and class primary key.
|
void |
deleteActivityCounters(String className,
long classPK)
Deletes all activity counters for the entity identified by the class name
and class primary key.
|
PersistedModel |
deletePersistedModel(PersistedModel persistedModel) |
SocialActivityCounter |
deleteSocialActivityCounter(long activityCounterId)
Deletes the social activity counter with the primary key from the database.
|
SocialActivityCounter |
deleteSocialActivityCounter(SocialActivityCounter socialActivityCounter)
Deletes the social activity counter from the database.
|
void |
disableActivityCounters(long classNameId,
long classPK)
Disables all the counters of an asset identified by the class name ID and
class primary key.
|
void |
disableActivityCounters(String className,
long classPK)
Disables all the counters of an asset identified by the class name and
class primary key.
|
<T> T |
dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
int |
dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
DynamicQuery |
dynamicQuery() |
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.
|
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
Performs a dynamic query on the database and returns a range of the matching rows.
|
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<T> orderByComparator)
Performs a dynamic query on the database and returns an ordered range of the matching rows.
|
long |
dynamicQueryCount(DynamicQuery dynamicQuery)
Returns the number of rows matching the dynamic query.
|
long |
dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection)
Returns the number of rows matching the dynamic query.
|
void |
enableActivityCounters(long classNameId,
long classPK)
Enables all activity counters of an asset identified by the class name ID
and class primary key.
|
void |
enableActivityCounters(String className,
long classPK)
Enables all the counters of an asset identified by the class name and
class primary key.
|
SocialActivityCounter |
fetchActivityCounterByEndPeriod(long groupId,
long classNameId,
long classPK,
String name,
int ownerType,
int endPeriod)
Returns the activity counter with the given name, owner, and end period
that belong to the given entity.
|
SocialActivityCounter |
fetchActivityCounterByStartPeriod(long groupId,
long classNameId,
long classPK,
String name,
int ownerType,
int startPeriod)
Returns the activity counter with the given name, owner, and start period
that belong to the given entity.
|
SocialActivityCounter |
fetchLatestActivityCounter(long groupId,
long classNameId,
long classPK,
String name,
int ownerType)
Returns the latest activity counter with the given name and owner that
belong to the given entity.
|
SocialActivityCounter |
fetchSocialActivityCounter(long activityCounterId) |
ActionableDynamicQuery |
getActionableDynamicQuery() |
CTPersistence<SocialActivityCounter> |
getCTPersistence() |
IndexableActionableDynamicQuery |
getIndexableActionableDynamicQuery() |
Class<SocialActivityCounter> |
getModelClass() |
List<SocialActivityCounter> |
getOffsetActivityCounters(long groupId,
String name,
int startOffset,
int endOffset)
Returns all the activity counters with the given name and period offsets.
|
List<SocialActivityCounter> |
getOffsetDistributionActivityCounters(long groupId,
String name,
int startOffset,
int endOffset)
Returns the distribution of the activity counters with the given name and
period offsets.
|
String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
List<SocialActivityCounter> |
getPeriodActivityCounters(long groupId,
String name,
int startPeriod,
int endPeriod)
Returns all the activity counters with the given name and time period.
|
List<SocialActivityCounter> |
getPeriodDistributionActivityCounters(long groupId,
String name,
int startPeriod,
int endPeriod)
Returns the distribution of activity counters with the given name and
time period.
|
PersistedModel |
getPersistedModel(Serializable primaryKeyObj) |
SocialActivityCounter |
getSocialActivityCounter(long activityCounterId)
Returns the social activity counter with the primary key.
|
List<SocialActivityCounter> |
getSocialActivityCounters(int start,
int end)
Returns a range of all the social activity counters.
|
int |
getSocialActivityCountersCount()
Returns the number of social activity counters.
|
List<Tuple> |
getUserActivityCounters(long groupId,
String[] rankingNames,
String[] selectedNames,
int start,
int end)
Returns the range of tuples that contain users and a list of activity
counters.
|
int |
getUserActivityCountersCount(long groupId,
String[] rankingNames)
Returns the number of users having a rank based on the given counters.
|
SocialActivityCounterLocalService |
getWrappedService() |
void |
incrementUserAchievementCounter(long userId,
long groupId)
Increments the
user.achievements counter for a user. |
void |
setWrappedService(SocialActivityCounterLocalService socialActivityCounterLocalService) |
SocialActivityCounter |
updateSocialActivityCounter(SocialActivityCounter socialActivityCounter)
Updates the social activity counter in the database or adds it if it does not yet exist.
|
<R,E extends Throwable> |
updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<SocialActivityCounter>,R,E> updateUnsafeFunction) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBasePersistence
public SocialActivityCounterLocalServiceWrapper()
public SocialActivityCounterLocalServiceWrapper(SocialActivityCounterLocalService socialActivityCounterLocalService)
public SocialActivityCounter addActivityCounter(long groupId, long classNameId, long classPK, String name, int ownerType, int totalValue, long previousActivityCounterId, int periodLength) throws PortalException
This method uses the lock service to guard against multiple threads trying to insert the same counter because this service is called asynchronously from the social activity service.
addActivityCounter
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupclassNameId
- the primary key of the entity's class this counter
belongs toclassPK
- the primary key of the entity this counter belongs toname
- the counter nameownerType
- the counter's owner type. Acceptable values are
TYPE_ACTOR
, TYPE_ASSET
and
TYPE_CREATOR
defined in SocialActivityCounterConstants
.totalValue
- the counter's total value (optionally 0
)previousActivityCounterId
- the primary key of the activity counter
for the previous time period (optionally 0
, if this
is the first)periodLength
- the period length in days,
PERIOD_LENGTH_INFINITE
for never ending counters or
PERIOD_LENGTH_SYSTEM
for the period length defined
in portal-ext.properties
. For more information see
SocialActivityCounterConstants
.PortalException
public void addActivityCounters(SocialActivity activity) throws PortalException
This method is called asynchronously from the social activity service
when the user performs an activity defined in
liferay-social.xml
.
This method first calls the activity processor class, if there is one
defined for the activity, checks for limits and increments all the
counters that belong to the activity. Afterwards, it processes the
activity with respect to achievement classes, if any. Lastly it
increments the built-in user.activities
and
asset.activities
counters.
addActivityCounters
in interface SocialActivityCounterLocalService
activity
- the social activityPortalException
public SocialActivityCounter addSocialActivityCounter(SocialActivityCounter socialActivityCounter)
Important: Inspect SocialActivityCounterLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
addSocialActivityCounter
in interface SocialActivityCounterLocalService
socialActivityCounter
- the social activity counterpublic PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
createPersistedModel
in interface PersistedModelLocalService
createPersistedModel
in interface SocialActivityCounterLocalService
PortalException
public SocialActivityCounter createSocialActivityCounter(long activityCounterId)
createSocialActivityCounter
in interface SocialActivityCounterLocalService
activityCounterId
- the primary key for the new social activity counterpublic void deleteActivityCounters(AssetEntry assetEntry) throws PortalException
This method subtracts the asset's popularity from the owner's contribution points. It also creates a new contribution period if the latest one does not belong to the current period.
deleteActivityCounters
in interface SocialActivityCounterLocalService
assetEntry
- the asset entryPortalException
public void deleteActivityCounters(long classNameId, long classPK) throws PortalException
deleteActivityCounters
in interface SocialActivityCounterLocalService
classNameId
- the primary key of the entity's classclassPK
- the primary key of the entityPortalException
public void deleteActivityCounters(String className, long classPK) throws PortalException
deleteActivityCounters
in interface SocialActivityCounterLocalService
className
- the entity's class nameclassPK
- the primary key of the entityPortalException
public PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
deletePersistedModel
in interface PersistedModelLocalService
deletePersistedModel
in interface SocialActivityCounterLocalService
PortalException
public SocialActivityCounter deleteSocialActivityCounter(long activityCounterId) throws PortalException
Important: Inspect SocialActivityCounterLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
deleteSocialActivityCounter
in interface SocialActivityCounterLocalService
activityCounterId
- the primary key of the social activity counterPortalException
- if a social activity counter with the primary key could not be foundpublic SocialActivityCounter deleteSocialActivityCounter(SocialActivityCounter socialActivityCounter)
Important: Inspect SocialActivityCounterLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
deleteSocialActivityCounter
in interface SocialActivityCounterLocalService
socialActivityCounter
- the social activity counterpublic void disableActivityCounters(long classNameId, long classPK) throws PortalException
This method is used by the recycle bin to disable all counters of assets put into the recycle bin. It adjusts the owner's contribution score.
disableActivityCounters
in interface SocialActivityCounterLocalService
classNameId
- the primary key of the asset's classclassPK
- the primary key of the assetPortalException
public void disableActivityCounters(String className, long classPK) throws PortalException
This method is used by the recycle bin to disable all counters of assets put into the recycle bin. It adjusts the owner's contribution score.
disableActivityCounters
in interface SocialActivityCounterLocalService
className
- the asset's class nameclassPK
- the primary key of the assetPortalException
public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
dslQuery
in interface PersistedModelLocalService
dslQuery
in interface SocialActivityCounterLocalService
public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
dslQueryCount
in interface PersistedModelLocalService
dslQueryCount
in interface SocialActivityCounterLocalService
public DynamicQuery dynamicQuery()
dynamicQuery
in interface SocialActivityCounterLocalService
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery
in interface SocialActivityCounterLocalService
dynamicQuery
- the dynamic querypublic <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.social.model.impl.SocialActivityCounterModelImpl
.
dynamicQuery
in interface SocialActivityCounterLocalService
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.social.model.impl.SocialActivityCounterModelImpl
.
dynamicQuery
in interface SocialActivityCounterLocalService
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public long dynamicQueryCount(DynamicQuery dynamicQuery)
dynamicQueryCount
in interface SocialActivityCounterLocalService
dynamicQuery
- the dynamic querypublic long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
dynamicQueryCount
in interface SocialActivityCounterLocalService
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the querypublic void enableActivityCounters(long classNameId, long classPK) throws PortalException
This method is used by the recycle bin to enable all counters of assets restored from the recycle bin. It adjusts the owner's contribution score.
enableActivityCounters
in interface SocialActivityCounterLocalService
classNameId
- the primary key of the asset's classclassPK
- the primary key of the assetPortalException
public void enableActivityCounters(String className, long classPK) throws PortalException
This method is used by the recycle bin to enable all counters of assets restored from the recycle bin. It adjusts the owner's contribution score.
enableActivityCounters
in interface SocialActivityCounterLocalService
className
- the asset's class nameclassPK
- the primary key of the assetPortalException
public SocialActivityCounter fetchActivityCounterByEndPeriod(long groupId, long classNameId, long classPK, String name, int ownerType, int endPeriod)
fetchActivityCounterByEndPeriod
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupclassNameId
- the primary key of the entity's classclassPK
- the primary key of the entityname
- the counter nameownerType
- the owner typeendPeriod
- the end period, -1
for the latest onepublic SocialActivityCounter fetchActivityCounterByStartPeriod(long groupId, long classNameId, long classPK, String name, int ownerType, int startPeriod)
fetchActivityCounterByStartPeriod
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupclassNameId
- the primary key of the entity's classclassPK
- the primary key of the entityname
- the counter nameownerType
- the owner typestartPeriod
- the start periodpublic SocialActivityCounter fetchLatestActivityCounter(long groupId, long classNameId, long classPK, String name, int ownerType)
fetchLatestActivityCounter
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupclassNameId
- the primary key of the entity's classclassPK
- the primary key of the entityname
- the counter nameownerType
- the owner typepublic SocialActivityCounter fetchSocialActivityCounter(long activityCounterId)
fetchSocialActivityCounter
in interface SocialActivityCounterLocalService
public ActionableDynamicQuery getActionableDynamicQuery()
getActionableDynamicQuery
in interface SocialActivityCounterLocalService
public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
getIndexableActionableDynamicQuery
in interface SocialActivityCounterLocalService
public List<SocialActivityCounter> getOffsetActivityCounters(long groupId, String name, int startOffset, int endOffset)
The start and end offsets can belong to different periods. This method groups the counters by name and returns the sum of their current values.
getOffsetActivityCounters
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupname
- the counter namestartOffset
- the offset for the start periodendOffset
- the offset for the end periodpublic List<SocialActivityCounter> getOffsetDistributionActivityCounters(long groupId, String name, int startOffset, int endOffset)
The start and end offsets can belong to different periods. This method groups the counters by their owner entity (usually some asset) and returns a counter for each entity class with the sum of the counters' current values.
getOffsetDistributionActivityCounters
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupname
- the counter namestartOffset
- the offset for the start periodendOffset
- the offset for the end periodpublic String getOSGiServiceIdentifier()
getOSGiServiceIdentifier
in interface SocialActivityCounterLocalService
public List<SocialActivityCounter> getPeriodActivityCounters(long groupId, String name, int startPeriod, int endPeriod)
The start and end period values can belong to different periods. This method groups the counters by name and returns the sum of their current values.
getPeriodActivityCounters
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupname
- the counter namestartPeriod
- the start periodendPeriod
- the end periodpublic List<SocialActivityCounter> getPeriodDistributionActivityCounters(long groupId, String name, int startPeriod, int endPeriod)
The start and end period values can belong to different periods. This method groups the counters by their owner entity (usually some asset) and returns a counter for each entity class with the sum of the counters' current values.
getPeriodDistributionActivityCounters
in interface SocialActivityCounterLocalService
groupId
- the primary key of the groupname
- the counter namestartPeriod
- the start periodendPeriod
- the end periodpublic PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
getPersistedModel
in interface PersistedModelLocalService
getPersistedModel
in interface SocialActivityCounterLocalService
PortalException
public SocialActivityCounter getSocialActivityCounter(long activityCounterId) throws PortalException
getSocialActivityCounter
in interface SocialActivityCounterLocalService
activityCounterId
- the primary key of the social activity counterPortalException
- if a social activity counter with the primary key could not be foundpublic List<SocialActivityCounter> getSocialActivityCounters(int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.social.model.impl.SocialActivityCounterModelImpl
.
getSocialActivityCounters
in interface SocialActivityCounterLocalService
start
- the lower bound of the range of social activity countersend
- the upper bound of the range of social activity counters (not inclusive)public int getSocialActivityCountersCount()
getSocialActivityCountersCount
in interface SocialActivityCounterLocalService
public List<Tuple> getUserActivityCounters(long groupId, String[] rankingNames, String[] selectedNames, int start, int end)
The counters returned for each user are passed to this method in the selectedNames array. The method also accepts an array of counter names that are used to rank the users.
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full
result set.
getUserActivityCounters
in interface SocialActivityCounterLocalService
groupId
- the primary key of the grouprankingNames
- the ranking counter namesselectedNames
- the counter names that will be returned with each
userstart
- the lower bound of the range of resultsend
- the upper bound of the range of results (not inclusive)public int getUserActivityCountersCount(long groupId, String[] rankingNames)
getUserActivityCountersCount
in interface SocialActivityCounterLocalService
groupId
- the primary key of the grouprankingNames
- the ranking counter namespublic void incrementUserAchievementCounter(long userId, long groupId) throws PortalException
user.achievements
counter for a user.
This method should be used by an external achievement class when the users unlocks an achievement.
incrementUserAchievementCounter
in interface SocialActivityCounterLocalService
userId
- the primary key of the usergroupId
- the primary key of the groupPortalException
public SocialActivityCounter updateSocialActivityCounter(SocialActivityCounter socialActivityCounter)
Important: Inspect SocialActivityCounterLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
updateSocialActivityCounter
in interface SocialActivityCounterLocalService
socialActivityCounter
- the social activity counterpublic CTPersistence<SocialActivityCounter> getCTPersistence()
getCTPersistence
in interface CTService<SocialActivityCounter>
getCTPersistence
in interface SocialActivityCounterLocalService
public Class<SocialActivityCounter> getModelClass()
getModelClass
in interface CTService<SocialActivityCounter>
getModelClass
in interface SocialActivityCounterLocalService
public <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<SocialActivityCounter>,R,E> updateUnsafeFunction) throws E extends Throwable
updateWithUnsafeFunction
in interface CTService<SocialActivityCounter>
updateWithUnsafeFunction
in interface SocialActivityCounterLocalService
E extends Throwable
public SocialActivityCounterLocalService getWrappedService()
getWrappedService
in interface ServiceWrapper<SocialActivityCounterLocalService>
public void setWrappedService(SocialActivityCounterLocalService socialActivityCounterLocalService)
setWrappedService
in interface ServiceWrapper<SocialActivityCounterLocalService>