Package io.keyko.nevermined.api.impl
Class ConditionsImpl
- java.lang.Object
-
- io.keyko.nevermined.api.impl.ConditionsImpl
-
- All Implemented Interfaces:
ConditionsAPI
public class ConditionsImpl extends Object implements ConditionsAPI
-
-
Field Summary
Fields Modifier and Type Field Description private ConditionsManager
conditionsManager
-
Constructor Summary
Constructors Constructor Description ConditionsImpl(ConditionsManager conditionsManager)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
grantAccess(String agreementId, DID did, String grantee)
Grant access to an address using the parity secret store.boolean
grantServiceExecution(String agreementId, DID did, String grantee)
Grant compute to an address using the parity secret store.boolean
lockReward(String agreementId, BigInteger amount)
Lock the amount of token that are going to be paid for the asset.boolean
refundReward(String agreementId, BigInteger amount)
Refund the payment to the consumer.boolean
releaseReward(String agreementId, BigInteger amount)
Release the payment to the provider address.
-
-
-
Field Detail
-
conditionsManager
private ConditionsManager conditionsManager
-
-
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 interfaceConditionsAPI
- Parameters:
agreementId
- the agreement idamount
- 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 interfaceConditionsAPI
- Parameters:
agreementId
- the agreement iddid
- the didgrantee
- 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 interfaceConditionsAPI
- Parameters:
agreementId
- the agreement iddid
- the didgrantee
- 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 interfaceConditionsAPI
- 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 interfaceConditionsAPI
- Parameters:
agreementId
- the agreement id.amount
- the amount to be refund.- Returns:
- a flag if the execution was good
- Throws:
Exception
- Exception
-
-