Class HistoryObjectDAO
- java.lang.Object
-
- org.silverpeas.core.silverstatistics.access.dao.HistoryObjectDAO
-
public class HistoryObjectDAO extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
add(Connection con, String userId, ResourceReference resourceReference, int actionType, String objectType)
static Stream<org.silverpeas.kernel.util.Pair<ContributionIdentifier,Integer>>
countByPeriodAndUser(Connection con, Collection<ContributionIdentifier> contributionIds, Date startDate, Date endDate, String userId)
static void
deleteHistoryByObject(Connection con, ResourceReference resourceReference, String objectType)
static void
deleteStatsOfComponent(Connection con, String componentId)
static SilverpeasList<HistoryObjectDetail>
findByCriteria(Connection con, HistoryCriteria criteria)
Finds all history data satisfying the given criteria.static SilverpeasList<HistoryByUser>
findByUserByCriteria(Connection con, HistoryCriteria criteria)
Finds by user last access date and number of access.static int
getCount(Connection con, Collection<ResourceReference> resourceReferences, String objectType)
static int
getCount(Connection con, ResourceReference resourceReference, String objectType)
static int
getCountByPeriod(Connection con, ResourceReference resourceRef, String objectType, Date startDate, Date endDate)
static Collection<HistoryObjectDetail>
getLastHistoryDetailOfObjectsForUser(Connection con, String userId, int actionType, String objectType, int nbObjects)
Gets the last history detail of each object associated to a user.static List<String>
getListObjectAccessByPeriod(Connection con, List<ResourceReference> primaryKeys, String objectType, Date startDate, Date endDate)
static List<String>
getListObjectAccessByPeriodAndUser(Connection con, List<ResourceReference> primaryKeys, String objectType, Date startDate, Date endDate, String userId)
static void
move(Connection con, ResourceReference toResourceReference, int actionType, String objectType)
-
-
-
Method Detail
-
add
public static void add(Connection con, String userId, ResourceReference resourceReference, int actionType, String objectType) throws SQLException
- Parameters:
con
- the database connectionuserId
- the user identifierresourceReference
-actionType
-objectType
-- Throws:
SQLException
-
findByUserByCriteria
public static SilverpeasList<HistoryByUser> findByUserByCriteria(Connection con, HistoryCriteria criteria) throws SQLException
Finds by user last access date and number of access.- Parameters:
con
- the database connection.criteria
- search criteria.- Returns:
- a
SilverpeasList
ofHistoryByUser
. - Throws:
SQLException
-
findByCriteria
public static SilverpeasList<HistoryObjectDetail> findByCriteria(Connection con, HistoryCriteria criteria) throws SQLException
Finds all history data satisfying the given criteria.- Parameters:
con
- the database connection.criteria
- search criteria.- Returns:
- a
SilverpeasList
ofHistoryObjectDetail
. - Throws:
SQLException
- on technical error with database.
-
deleteHistoryByObject
public static void deleteHistoryByObject(Connection con, ResourceReference resourceReference, String objectType) throws SQLException
- Parameters:
con
- the database connectionresourceReference
-objectType
-- Throws:
SQLException
-
deleteStatsOfComponent
public static void deleteStatsOfComponent(Connection con, String componentId) throws SQLException
- Throws:
SQLException
-
getCount
public static int getCount(Connection con, Collection<ResourceReference> resourceReferences, String objectType) throws SQLException
- Throws:
SQLException
-
getCount
public static int getCount(Connection con, ResourceReference resourceReference, String objectType) throws SQLException
- Throws:
SQLException
-
getCountByPeriod
public static int getCountByPeriod(Connection con, ResourceReference resourceRef, String objectType, Date startDate, Date endDate) throws SQLException
- Throws:
SQLException
-
countByPeriodAndUser
public static Stream<org.silverpeas.kernel.util.Pair<ContributionIdentifier,Integer>> countByPeriodAndUser(Connection con, Collection<ContributionIdentifier> contributionIds, Date startDate, Date endDate, String userId) throws SQLException
- Throws:
SQLException
-
move
public static void move(Connection con, ResourceReference toResourceReference, int actionType, String objectType) throws SQLException
- Throws:
SQLException
-
getListObjectAccessByPeriod
public static List<String> getListObjectAccessByPeriod(Connection con, List<ResourceReference> primaryKeys, String objectType, Date startDate, Date endDate) throws SQLException
- Throws:
SQLException
-
getListObjectAccessByPeriodAndUser
public static List<String> getListObjectAccessByPeriodAndUser(Connection con, List<ResourceReference> primaryKeys, String objectType, Date startDate, Date endDate, String userId) throws SQLException
- Throws:
SQLException
-
getLastHistoryDetailOfObjectsForUser
public static Collection<HistoryObjectDetail> getLastHistoryDetailOfObjectsForUser(Connection con, String userId, int actionType, String objectType, int nbObjects) throws SQLException
Gets the last history detail of each object associated to a user. The result is sorted on the datetime from the youngest to the oldest- Parameters:
con
-userId
-actionType
-objectType
-nbObjects
-- Returns:
- Throws:
SQLException
-
-