Class ConditionsImpl

    • Constructor Detail

      • ConditionsImpl

        public ConditionsImpl​(ConditionsManager conditionsManager)
        Constructor
        Parameters:
        conditionsManager - the conditionsManager
    • Method Detail

      • lockReward

        public boolean lockReward​(String agreementId,
                                  BigInteger amount)
                           throws Exception
        Description copied from interface: ConditionsAPI
        Lock the amount of token that are going to be paid for the asset.
        Specified by:
        lockReward in interface ConditionsAPI
        Parameters:
        agreementId - the agreement id
        amount - the amount to be locked
        Returns:
        a flag if the execution was good
        Throws:
        Exception - Exception
      • grantAccess

        public boolean grantAccess​(String agreementId,
                                   DID did,
                                   String grantee)
                            throws Exception
        Description copied from interface: ConditionsAPI
        Grant access to an address using the parity secret store.
        Specified by:
        grantAccess in interface ConditionsAPI
        Parameters:
        agreementId - the agreement id
        did - the did
        grantee - the address that is going to be granted to access the data.
        Returns:
        a flag if the execution was good
        Throws:
        Exception - Exception
      • grantServiceExecution

        public boolean grantServiceExecution​(String agreementId,
                                             DID did,
                                             String grantee)
                                      throws Exception
        Description copied from interface: ConditionsAPI
        Grant compute to an address using the parity secret store.
        Specified by:
        grantServiceExecution in interface ConditionsAPI
        Parameters:
        agreementId - the agreement id
        did - the did
        grantee - the address that is going to be granted to execute the compute service.
        Returns:
        a flag if the execution was good
        Throws:
        Exception - Exception
      • releaseReward

        public boolean releaseReward​(String agreementId,
                                     BigInteger amount)
                              throws Exception
        Description copied from interface: ConditionsAPI
        Release the payment to the provider address.
        Specified by:
        releaseReward in interface ConditionsAPI
        Parameters:
        agreementId - the agreement id.
        amount - the amount to be released.
        Returns:
        a flag if the execution was good
        Throws:
        Exception - Exception
      • refundReward

        public boolean refundReward​(String agreementId,
                                    BigInteger amount)
                             throws Exception
        Description copied from interface: ConditionsAPI
        Refund the payment to the consumer.
        Specified by:
        refundReward in interface ConditionsAPI
        Parameters:
        agreementId - the agreement id.
        amount - the amount to be refund.
        Returns:
        a flag if the execution was good
        Throws:
        Exception - Exception