Class SocialActivityCounterLocalServiceWrapper

Object
com.liferay.social.kernel.service.SocialActivityCounterLocalServiceWrapper
All Implemented Interfaces:
BaseLocalService, CTService<SocialActivityCounter>, PersistedModelLocalService, ServiceWrapper<SocialActivityCounterLocalService>, SocialActivityCounterLocalService

public class SocialActivityCounterLocalServiceWrapper extends Object implements ServiceWrapper<SocialActivityCounterLocalService>, SocialActivityCounterLocalService
Provides a wrapper for SocialActivityCounterLocalService.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Constructor Details

    • SocialActivityCounterLocalServiceWrapper

      public SocialActivityCounterLocalServiceWrapper()
    • SocialActivityCounterLocalServiceWrapper

      public SocialActivityCounterLocalServiceWrapper(SocialActivityCounterLocalService socialActivityCounterLocalService)
  • Method Details

    • addActivityCounter

      public SocialActivityCounter addActivityCounter(long groupId, long classNameId, long classPK, String name, int ownerType, int totalValue, long previousActivityCounterId, int periodLength) throws PortalException
      Adds an activity counter specifying a previous activity and period length.

      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.

      Specified by:
      addActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      classNameId - the primary key of the entity's class this counter belongs to
      classPK - the primary key of the entity this counter belongs to
      name - the counter name
      ownerType - 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.
      Returns:
      the added activity counter
      Throws:
      PortalException
    • addActivityCounters

      public void addActivityCounters(SocialActivity activity) throws PortalException
      Adds or increments activity counters related to an activity.

      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.

      Specified by:
      addActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      activity - the social activity
      Throws:
      PortalException
    • addSocialActivityCounter

      public SocialActivityCounter addSocialActivityCounter(SocialActivityCounter socialActivityCounter)
      Adds the social activity counter to the database. Also notifies the appropriate model listeners.

      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.

      Specified by:
      addSocialActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      socialActivityCounter - the social activity counter
      Returns:
      the social activity counter that was added
    • createPersistedModel

      public PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      createPersistedModel in interface PersistedModelLocalService
      Specified by:
      createPersistedModel in interface SocialActivityCounterLocalService
      Throws:
      PortalException
      PortalException
    • createSocialActivityCounter

      public SocialActivityCounter createSocialActivityCounter(long activityCounterId)
      Creates a new social activity counter with the primary key. Does not add the social activity counter to the database.
      Specified by:
      createSocialActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      activityCounterId - the primary key for the new social activity counter
      Returns:
      the new social activity counter
    • deleteActivityCounters

      public void deleteActivityCounters(AssetEntry assetEntry) throws PortalException
      Deletes all activity counters, limits, and settings related to the asset.

      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.

      Specified by:
      deleteActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      assetEntry - the asset entry
      Throws:
      PortalException
    • deleteActivityCounters

      public void deleteActivityCounters(long classNameId, long classPK) throws PortalException
      Deletes all activity counters, limits, and settings related to the entity identified by the class name ID and class primary key.
      Specified by:
      deleteActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      classNameId - the primary key of the entity's class
      classPK - the primary key of the entity
      Throws:
      PortalException
    • deleteActivityCounters

      public void deleteActivityCounters(String className, long classPK) throws PortalException
      Deletes all activity counters for the entity identified by the class name and class primary key.
      Specified by:
      deleteActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      className - the entity's class name
      classPK - the primary key of the entity
      Throws:
      PortalException
    • deletePersistedModel

      public PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Specified by:
      deletePersistedModel in interface PersistedModelLocalService
      Specified by:
      deletePersistedModel in interface SocialActivityCounterLocalService
      Throws:
      PortalException
      PortalException
    • deleteSocialActivityCounter

      public SocialActivityCounter deleteSocialActivityCounter(long activityCounterId) throws PortalException
      Deletes the social activity counter with the primary key from the database. Also notifies the appropriate model listeners.

      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.

      Specified by:
      deleteSocialActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      activityCounterId - the primary key of the social activity counter
      Returns:
      the social activity counter that was removed
      Throws:
      PortalException - if a social activity counter with the primary key could not be found
      PortalException
    • deleteSocialActivityCounter

      public SocialActivityCounter deleteSocialActivityCounter(SocialActivityCounter socialActivityCounter)
      Deletes the social activity counter from the database. Also notifies the appropriate model listeners.

      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.

      Specified by:
      deleteSocialActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      socialActivityCounter - the social activity counter
      Returns:
      the social activity counter that was removed
    • disableActivityCounters

      public void disableActivityCounters(long classNameId, long classPK) throws PortalException
      Disables all the counters of an asset identified by the class name ID and class primary key.

      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.

      Specified by:
      disableActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      classNameId - the primary key of the asset's class
      classPK - the primary key of the asset
      Throws:
      PortalException
    • disableActivityCounters

      public void disableActivityCounters(String className, long classPK) throws PortalException
      Disables all the counters of an asset identified by the class name and class primary key.

      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.

      Specified by:
      disableActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      className - the asset's class name
      classPK - the primary key of the asset
      Throws:
      PortalException
    • dslQuery

      public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQuery in interface PersistedModelLocalService
      Specified by:
      dslQuery in interface SocialActivityCounterLocalService
    • dslQueryCount

      public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQueryCount in interface PersistedModelLocalService
      Specified by:
      dslQueryCount in interface SocialActivityCounterLocalService
    • dynamicQuery

      public DynamicQuery dynamicQuery()
      Specified by:
      dynamicQuery in interface SocialActivityCounterLocalService
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Specified by:
      dynamicQuery in interface SocialActivityCounterLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public <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.

      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.

      Specified by:
      dynamicQuery in interface SocialActivityCounterLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      Returns:
      the range of matching rows
    • dynamicQuery

      public <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.

      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.

      Specified by:
      dynamicQuery in interface SocialActivityCounterLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface SocialActivityCounterLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface SocialActivityCounterLocalService
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • enableActivityCounters

      public void enableActivityCounters(long classNameId, long classPK) throws PortalException
      Enables all activity counters of an asset identified by the class name ID and class primary key.

      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.

      Specified by:
      enableActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      classNameId - the primary key of the asset's class
      classPK - the primary key of the asset
      Throws:
      PortalException
    • enableActivityCounters

      public void enableActivityCounters(String className, long classPK) throws PortalException
      Enables all the counters of an asset identified by the class name and class primary key.

      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.

      Specified by:
      enableActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      className - the asset's class name
      classPK - the primary key of the asset
      Throws:
      PortalException
    • fetchActivityCounterByEndPeriod

      public 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.
      Specified by:
      fetchActivityCounterByEndPeriod in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      classNameId - the primary key of the entity's class
      classPK - the primary key of the entity
      name - the counter name
      ownerType - the owner type
      endPeriod - the end period, -1 for the latest one
      Returns:
      the matching activity counter
    • fetchActivityCounterByStartPeriod

      public 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.
      Specified by:
      fetchActivityCounterByStartPeriod in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      classNameId - the primary key of the entity's class
      classPK - the primary key of the entity
      name - the counter name
      ownerType - the owner type
      startPeriod - the start period
      Returns:
      the matching activity counter
    • fetchLatestActivityCounter

      public 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.
      Specified by:
      fetchLatestActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      classNameId - the primary key of the entity's class
      classPK - the primary key of the entity
      name - the counter name
      ownerType - the owner type
      Returns:
      the matching activity counter
    • fetchSocialActivityCounter

      public SocialActivityCounter fetchSocialActivityCounter(long activityCounterId)
      Specified by:
      fetchSocialActivityCounter in interface SocialActivityCounterLocalService
    • getActionableDynamicQuery

      public ActionableDynamicQuery getActionableDynamicQuery()
      Specified by:
      getActionableDynamicQuery in interface SocialActivityCounterLocalService
    • getIndexableActionableDynamicQuery

      public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
      Specified by:
      getIndexableActionableDynamicQuery in interface SocialActivityCounterLocalService
    • getOffsetActivityCounters

      public List<SocialActivityCounter> getOffsetActivityCounters(long groupId, String name, int startOffset, int endOffset)
      Returns all the activity counters with the given name and period offsets.

      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.

      Specified by:
      getOffsetActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      name - the counter name
      startOffset - the offset for the start period
      endOffset - the offset for the end period
      Returns:
      the matching activity counters
    • getOffsetDistributionActivityCounters

      public 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.

      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.

      Specified by:
      getOffsetDistributionActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      name - the counter name
      startOffset - the offset for the start period
      endOffset - the offset for the end period
      Returns:
      the distribution of matching activity counters
    • getOSGiServiceIdentifier

      public String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Specified by:
      getOSGiServiceIdentifier in interface SocialActivityCounterLocalService
      Returns:
      the OSGi service identifier
    • getPeriodActivityCounters

      public List<SocialActivityCounter> getPeriodActivityCounters(long groupId, String name, int startPeriod, int endPeriod)
      Returns all the activity counters with the given name and time period.

      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.

      Specified by:
      getPeriodActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      name - the counter name
      startPeriod - the start period
      endPeriod - the end period
      Returns:
      the matching activity counters
    • getPeriodDistributionActivityCounters

      public List<SocialActivityCounter> getPeriodDistributionActivityCounters(long groupId, String name, int startPeriod, int endPeriod)
      Returns the distribution of activity counters with the given name and time period.

      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.

      Specified by:
      getPeriodDistributionActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      name - the counter name
      startPeriod - the start period
      endPeriod - the end period
      Returns:
      the distribution of matching activity counters
    • getPersistedModel

      public PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      getPersistedModel in interface PersistedModelLocalService
      Specified by:
      getPersistedModel in interface SocialActivityCounterLocalService
      Throws:
      PortalException
      PortalException
    • getSocialActivityCounter

      public SocialActivityCounter getSocialActivityCounter(long activityCounterId) throws PortalException
      Returns the social activity counter with the primary key.
      Specified by:
      getSocialActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      activityCounterId - the primary key of the social activity counter
      Returns:
      the social activity counter
      Throws:
      PortalException - if a social activity counter with the primary key could not be found
      PortalException
    • getSocialActivityCounters

      public List<SocialActivityCounter> getSocialActivityCounters(int start, int end)
      Returns a range of all the social activity counters.

      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.

      Specified by:
      getSocialActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      start - the lower bound of the range of social activity counters
      end - the upper bound of the range of social activity counters (not inclusive)
      Returns:
      the range of social activity counters
    • getSocialActivityCountersCount

      public int getSocialActivityCountersCount()
      Returns the number of social activity counters.
      Specified by:
      getSocialActivityCountersCount in interface SocialActivityCounterLocalService
      Returns:
      the number of social activity counters
    • getUserActivityCounters

      public 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.

      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.

      Specified by:
      getUserActivityCounters in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      rankingNames - the ranking counter names
      selectedNames - the counter names that will be returned with each user
      start - the lower bound of the range of results
      end - the upper bound of the range of results (not inclusive)
      Returns:
      the range of matching tuples
    • getUserActivityCountersCount

      public int getUserActivityCountersCount(long groupId, String[] rankingNames)
      Returns the number of users having a rank based on the given counters.
      Specified by:
      getUserActivityCountersCount in interface SocialActivityCounterLocalService
      Parameters:
      groupId - the primary key of the group
      rankingNames - the ranking counter names
      Returns:
      the number of matching users
    • incrementUserAchievementCounter

      public void incrementUserAchievementCounter(long userId, long groupId) throws PortalException
      Increments the user.achievements counter for a user.

      This method should be used by an external achievement class when the users unlocks an achievement.

      Specified by:
      incrementUserAchievementCounter in interface SocialActivityCounterLocalService
      Parameters:
      userId - the primary key of the user
      groupId - the primary key of the group
      Throws:
      PortalException
    • updateSocialActivityCounter

      public SocialActivityCounter updateSocialActivityCounter(SocialActivityCounter socialActivityCounter)
      Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      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.

      Specified by:
      updateSocialActivityCounter in interface SocialActivityCounterLocalService
      Parameters:
      socialActivityCounter - the social activity counter
      Returns:
      the social activity counter that was updated
    • getBasePersistence

      public BasePersistence<?> getBasePersistence()
      Specified by:
      getBasePersistence in interface PersistedModelLocalService
    • getCTPersistence

      public CTPersistence<SocialActivityCounter> getCTPersistence()
      Specified by:
      getCTPersistence in interface CTService<SocialActivityCounter>
      Specified by:
      getCTPersistence in interface SocialActivityCounterLocalService
    • getModelClass

      public Class<SocialActivityCounter> getModelClass()
      Specified by:
      getModelClass in interface CTService<SocialActivityCounter>
      Specified by:
      getModelClass in interface SocialActivityCounterLocalService
    • updateWithUnsafeFunction

      public <R, E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<SocialActivityCounter>,R,E> updateUnsafeFunction) throws E
      Specified by:
      updateWithUnsafeFunction in interface CTService<SocialActivityCounter>
      Specified by:
      updateWithUnsafeFunction in interface SocialActivityCounterLocalService
      Throws:
      E extends Throwable
    • getWrappedService

      public SocialActivityCounterLocalService getWrappedService()
      Specified by:
      getWrappedService in interface ServiceWrapper<SocialActivityCounterLocalService>
    • setWrappedService

      public void setWrappedService(SocialActivityCounterLocalService socialActivityCounterLocalService)
      Specified by:
      setWrappedService in interface ServiceWrapper<SocialActivityCounterLocalService>