Class ConditionsManager

    • Field Detail

      • log

        private static final org.apache.logging.log4j.Logger log
    • Method Detail

      • getInstance

        public static ConditionsManager getInstance​(KeeperService keeperService,
                                                    AquariusService aquariusService)
        Given the KeeperService and AquariusService, returns a new instance of ConditionsManager using them as attributes
        Parameters:
        keeperService - Keeper Dto
        aquariusService - Provider Dto
        Returns:
        ConditionsManager
      • lockReward

        public Boolean lockReward​(String agreementId,
                                  BigInteger amount)
                           throws Exception
        Lock reward for a service agreement.
        Parameters:
        agreementId - the agreement id.
        amount - the amount to be locked.
        Returns:
        a flag true if was executed successfully.
        Throws:
        Exception - exception
      • grantAccess

        public Boolean grantAccess​(String agreementId,
                                   DID did,
                                   String granteeAddress)
                            throws Exception
        Grant access to an address to consume a did.
        Parameters:
        agreementId - the agreement id.
        did - the did.
        granteeAddress - an eth address.
        Returns:
        a flag true if was executed successfully.
        Throws:
        Exception - exception
      • releaseReward

        public Boolean releaseReward​(String agreementId,
                                     BigInteger amount)
                              throws Exception
        Release reward to the address after the access was granted.
        Parameters:
        agreementId - the agreement id.
        amount - the price.
        Returns:
        a flag true if was executed successfully.
        Throws:
        Exception - exception
      • refundReward

        public Boolean refundReward​(String agreementId,
                                    BigInteger amount)
                             throws Exception
        Refund the price in case that some of the step was wrong.
        Parameters:
        agreementId - the agreement id.
        amount - the price.
        Returns:
        a flag true if was executed successfully.
        Throws:
        Exception - exception