Class GamificationHistoryDAO

    • Constructor Detail

      • GamificationHistoryDAO

        public GamificationHistoryDAO()
    • Method Detail

      • findAllActionsHistoryAgnostic

        public List<StandardLeaderboard> findAllActionsHistoryAgnostic​(IdentityType earnerType)
        Get all ActionHistory records and convert them to list of type StandardLeaderboard
        Parameters:
        earnerType - : IdentityType USER or SPACE
        Returns:
        list of type StandardLeaderboard
      • findAllActionsHistoryByDateByDomain

        public List<StandardLeaderboard> findAllActionsHistoryByDateByDomain​(IdentityType earnerType,
                                                                             Date date,
                                                                             String domain)
        Find all gamification entries by domain and by type
        Parameters:
        earnerType - : IdentityType USER or SPACE
        date - : date from when we load gamification entries
        domain - : domain filter
        Returns:
        list of object of type StandardLeaderboard
      • findAllActionsHistoryByDomain

        public List<StandardLeaderboard> findAllActionsHistoryByDomain​(IdentityType earnerType,
                                                                       String domain)
        Find all gamification entries by domain
        Parameters:
        earnerType - : IdentityType USER or SPACE
        domain - : domain filter
        Returns:
        list of object of type StandardLeaderboard
      • findAllActionsHistoryByDomain

        public List<StandardLeaderboard> findAllActionsHistoryByDomain​(String domain,
                                                                       IdentityType earnerType,
                                                                       int limit)
        Find all gamification entries by domain
        Parameters:
        domain - : domain filter
        earnerType - : IdentityType USER or SPACE
        limit - : limit of the query
        Returns:
        list of object of type StandardLeaderboard
      • findAllActionsHistoryByDate

        public List<StandardLeaderboard> findAllActionsHistoryByDate​(IdentityType earnerType,
                                                                     Date date)
        Find all gamification entries by date
        Parameters:
        date - : date from when entries are loaded
        earnerType - : IdentityType USER or SPACE
        Returns:
        list of object of type StandardLeaderboard
      • findAllActionsHistoryByDate

        public List<StandardLeaderboard> findAllActionsHistoryByDate​(Date date,
                                                                     IdentityType earnerType,
                                                                     int limit)
        Find all gamification entries by date
        Parameters:
        date - : date from when entries are loaded
        earnerType - : IdentityType USER or SPACE
        limit - : limit of the query
        Returns:
        list of object of type StandardLeaderboard
      • findActionsHistoryByEarnerId

        public List<GamificationActionsHistory> findActionsHistoryByEarnerId​(String earnerId,
                                                                             int limit)
        Get an ActionHistory record based on userId
        Parameters:
        earnerId - : the userId used in projection
        limit - : limit of the query
        Returns:
        list of objects of type GamificationActionsHistory
      • findAllActionsHistory

        public List<StandardLeaderboard> findAllActionsHistory​(IdentityType earnerType,
                                                               int limit)
        Get all ActionHistory records paginated
        Parameters:
        earnerType - : IdentityType USER or SPACE
        limit - : limit of the query
        Returns:
        list of object of type StandardLeaderboard
      • findActionHistoryByDateByEarnerId

        public List<GamificationActionsHistory> findActionHistoryByDateByEarnerId​(Date date,
                                                                                  String earnerId)
        Get The last ActionHistory record
        Parameters:
        date - : date from when we aim to track the user
        earnerId - identity id of earner
        Returns:
        an instance of type GamificationActionsHistory
      • findActionsHistoryByDateByDomain

        public List<StandardLeaderboard> findActionsHistoryByDateByDomain​(Date date,
                                                                          IdentityType earnerType,
                                                                          String domain,
                                                                          int limit)
        Find actionsHistory by data and domain
        Parameters:
        date - : date from when we aim to track user
        earnerType - : IdentityType USER or SPACE
        domain - : domain we aim to track
        limit - : how many records we should load from DB
        Returns:
        a list of object of type StandardLraderboard
      • findStatsByUserId

        public List<PiechartLeaderboard> findStatsByUserId​(String earnerId,
                                                           Date fromDate,
                                                           Date toDate)
        Get earner stats
        Parameters:
        earnerId - identity id of earner
        fromDate -
        toDate -
        Returns:
        a list of objects of type PiechartLeaderboard
      • findDomainScoreByIdentityId

        public List<ProfileReputation> findDomainScoreByIdentityId​(String earnerId)
        Compute for a given user the score earned for each doman
        Parameters:
        earnerId - ProfileReputation
        Returns:
        a list of objects of type
      • findUserReputationScoreBetweenDate

        public long findUserReputationScoreBetweenDate​(String earnerId,
                                                       Date fromDate,
                                                       Date toDate)
      • findUserReputationScoreByMonth

        public long findUserReputationScoreByMonth​(String earnerId,
                                                   Date currentMonth)
      • findUserReputationScoreByDomainBetweenDate

        public long findUserReputationScoreByDomainBetweenDate​(String earnerId,
                                                               String domain,
                                                               Date fromDate,
                                                               Date toDate)
      • findActionsHistoryByEarnerIdSortedByDate

        public List<GamificationActionsHistory> findActionsHistoryByEarnerIdSortedByDate​(String earnerId,
                                                                                         int limit)
        Find actionsHistory by data and domain and date and points
        Parameters:
        earnerId - : earner identity id
        limit - : how many records we should load from DB
        Returns:
        a list of object of type GamificationActionsHistory
      • getTotalScore

        public long getTotalScore​(String earnerId)
      • getDomainList

        public List<String> getDomainList()