Class DefaultStatisticService
- java.lang.Object
-
- org.silverpeas.core.silverstatistics.access.service.DefaultStatisticService
-
- All Implemented Interfaces:
ComponentInstanceDeletion,StatisticService
@Service @Singleton public class DefaultStatisticService extends Object implements StatisticService, ComponentInstanceDeletion
Default implementation of Statistic service layer which manage statistics
-
-
Field Summary
Fields Modifier and Type Field Description static intACTION_ACCESS
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultStatisticService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStat(String userId, SilverpeasContent content)voidaddStat(String userId, ResourceReference resourceReference, int actionType, String objectType)voiddelete(String componentInstanceId)Deletes the resources belonging to the specified component instance.voiddeleteStats(SilverpeasContent content)voiddeleteStats(ResourceReference resourceReference, String objectType)<T extends Contribution>
Stream<T>filterRead(Collection<T> contributions, String userId)Filters the given contributions in order to keep only those read by the user represented by the given identifier.intgetCount(List<ResourceReference> resourceReferences, int action, String objectType)intgetCount(SilverpeasContent content)intgetCount(SilverpeasContent content, int action)intgetCount(ResourceReference resourceReference, int action, String objectType)intgetCount(ResourceReference resourceReference, String objectType)intgetCountByPeriod(List<ResourceReference> refs, int action, String objectType, Date startDate, Date endDate)intgetCountByPeriodAndUser(List<ResourceReference> refs, String objectType, Date startDate, Date endDate, List<String> userIds)intgetDistinctCountByPeriod(List<ResourceReference> refs, int action, String objectType, Date startDate, Date endDate)intgetDistinctCountByPeriodUser(List<ResourceReference> refs, int action, String objectType, Date startDate, Date endDate, List<String> userIds)SilverpeasList<HistoryObjectDetail>getHistoryByAction(ResourceReference resourceReference, int action, String objectType, Collection<String> excludedUserIds, PaginationPage pagination)List<HistoryByUser>getHistoryByObject(ResourceReference resourceReference, int action, String objectType)List<HistoryByUser>getHistoryByObject(ResourceReference resourceReference, int action, String objectType, List<String> userIds)SilverpeasList<HistoryObjectDetail>getHistoryByObjectAndUser(ResourceReference resourceReference, int action, String objectType, String userId, PaginationPage paginationPage, HistoryCriteria.QUERY_ORDER_BY orderBy)List<HistoryByUser>getHistoryByUser(ResourceReference resourceReference, int action, String objectType)Collection<HistoryObjectDetail>getLastHistoryOfObjectsForUser(String userId, int actionType, String objectType, int nbObjects)Gets the last history detail of each object associated to a user.voidmoveStat(ResourceReference toResourceReference, int actionType, String objectType)
-
-
-
Field Detail
-
ACTION_ACCESS
public static final int ACTION_ACCESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
addStat
public void addStat(String userId, ResourceReference resourceReference, int actionType, String objectType)
- Specified by:
addStatin interfaceStatisticService
-
addStat
public void addStat(String userId, SilverpeasContent content)
- Specified by:
addStatin interfaceStatisticService
-
getCount
public int getCount(List<ResourceReference> resourceReferences, int action, String objectType)
- Specified by:
getCountin interfaceStatisticService
-
getCount
public int getCount(ResourceReference resourceReference, int action, String objectType)
- Specified by:
getCountin interfaceStatisticService
-
getCount
public int getCount(SilverpeasContent content, int action)
- Specified by:
getCountin interfaceStatisticService
-
getCount
public int getCount(ResourceReference resourceReference, String objectType)
- Specified by:
getCountin interfaceStatisticService
-
getCount
public int getCount(SilverpeasContent content)
- Specified by:
getCountin interfaceStatisticService
-
getHistoryByUser
public List<HistoryByUser> getHistoryByUser(ResourceReference resourceReference, int action, String objectType)
- Specified by:
getHistoryByUserin interfaceStatisticService
-
getHistoryByAction
public SilverpeasList<HistoryObjectDetail> getHistoryByAction(ResourceReference resourceReference, int action, String objectType, Collection<String> excludedUserIds, PaginationPage pagination)
- Specified by:
getHistoryByActionin interfaceStatisticService
-
getHistoryByObjectAndUser
public SilverpeasList<HistoryObjectDetail> getHistoryByObjectAndUser(ResourceReference resourceReference, int action, String objectType, String userId, PaginationPage paginationPage, HistoryCriteria.QUERY_ORDER_BY orderBy)
- Specified by:
getHistoryByObjectAndUserin interfaceStatisticService
-
getHistoryByObject
public List<HistoryByUser> getHistoryByObject(ResourceReference resourceReference, int action, String objectType)
- Specified by:
getHistoryByObjectin interfaceStatisticService
-
getHistoryByObject
public List<HistoryByUser> getHistoryByObject(ResourceReference resourceReference, int action, String objectType, List<String> userIds)
- Specified by:
getHistoryByObjectin interfaceStatisticService
-
deleteStats
public void deleteStats(ResourceReference resourceReference, String objectType)
- Specified by:
deleteStatsin interfaceStatisticService
-
deleteStats
public void deleteStats(SilverpeasContent content)
- Specified by:
deleteStatsin interfaceStatisticService
-
moveStat
public void moveStat(ResourceReference toResourceReference, int actionType, String objectType)
- Specified by:
moveStatin interfaceStatisticService
-
getCountByPeriod
public int getCountByPeriod(List<ResourceReference> refs, int action, String objectType, Date startDate, Date endDate)
- Specified by:
getCountByPeriodin interfaceStatisticServiceobjectType- String representation of an object typestartDate- the start dateendDate- the end date- Returns:
- the number of access over a list of publications between startDate and endDate
-
getCountByPeriodAndUser
public int getCountByPeriodAndUser(List<ResourceReference> refs, String objectType, Date startDate, Date endDate, List<String> userIds)
- Specified by:
getCountByPeriodAndUserin interfaceStatisticServiceobjectType- String representation of an object typestartDate- the start dateendDate- the end dateuserIds- the user identifiers- Returns:
- the number of access over a list of publications between startDate and endDate for specific user
-
getDistinctCountByPeriod
public int getDistinctCountByPeriod(List<ResourceReference> refs, int action, String objectType, Date startDate, Date endDate)
- Specified by:
getDistinctCountByPeriodin interfaceStatisticServiceobjectType- String representation of an object typestartDate- the start dateendDate- the end date- Returns:
- the number of access over a list of publications between startDate and endDate
-
getDistinctCountByPeriodUser
public int getDistinctCountByPeriodUser(List<ResourceReference> refs, int action, String objectType, Date startDate, Date endDate, List<String> userIds)
- Specified by:
getDistinctCountByPeriodUserin interfaceStatisticService
-
getLastHistoryOfObjectsForUser
public Collection<HistoryObjectDetail> getLastHistoryOfObjectsForUser(String userId, int actionType, String objectType, int nbObjects)
Description copied from interface:StatisticServiceGets the last history detail of each object associated to a user. The result is sorted on the datetime from the youngest to the oldest and limited according to the nbObjects parameter.- Specified by:
getLastHistoryOfObjectsForUserin interfaceStatisticService- Returns:
- ordered list of unique objects used by the user
-
filterRead
public <T extends Contribution> Stream<T> filterRead(Collection<T> contributions, String userId)
Description copied from interface:StatisticServiceFilters the given contributions in order to keep only those read by the user represented by the given identifier.- Specified by:
filterReadin interfaceStatisticService- Type Parameters:
T- the type of contribution.- Parameters:
contributions- the contributions to filter.userId- the identifier of the user to verify.- Returns:
- a stream of read
-
delete
public void delete(String componentInstanceId)
Deletes the resources belonging to the specified component instance. This method is invoked by Silverpeas when a component instance is being deleted.- Specified by:
deletein interfaceComponentInstanceDeletion- Parameters:
componentInstanceId- the unique identifier of a component instance.
-
-