Interface RewardReportService


  • public interface RewardReportService
    A storage service to save/load reward settings
    • Method Detail

      • computeRewards

        RewardReport computeRewards​(long periodDateInSeconds)
        Compute rewards swicth configurations for the list of identities passed in parameters
        Parameters:
        periodDateInSeconds - a timestamp in seconds inside the period time that will be retrieved
        Returns:
        a Set of WalletReward with the details of sent tokens and tokens to send
      • sendRewards

        void sendRewards​(long periodDateInSeconds,
                         String username)
                  throws Exception
        Send rewards transactions
        Parameters:
        periodDateInSeconds - a timestamp in seconds inside the period time that will be retrieved
        username - current username sending rewards
        Throws:
        Exception - if an error occurs while sending the rewards transactions on blockchain
      • getRewardReport

        RewardReport getRewardReport​(long periodTimeInSeconds)
        Retrieve a RewardReport corresponding to a period of time
        Parameters:
        periodTimeInSeconds - selected date period
        Returns:
        RewardReport if there is a saved one, else null
      • saveRewardReport

        void saveRewardReport​(RewardReport rewardReport)
        Parameters:
        rewardReport - save generated reward report
      • listRewards

        List<WalletReward> listRewards​(String currentUser,
                                       int limit)
        Parameters:
        currentUser - current user listing his rewards
        limit - size limit of items to return
        Returns:
        a List of WalletReward of current user
      • countRewards

        double countRewards​(String currentUser)
        Parameters:
        currentUser - the current user listing his rewards
        Returns:
        a total rewards sent for current person
      • replaceRewardTransactions

        void replaceRewardTransactions​(String oldHash,
                                       String newHash)
        Replaces an old reward transaction hash to a new one, that had boosted the first one
        Parameters:
        oldHash - old Transaction hash
        newHash - new Transaction hash