Package com.oceanprotocol.squid.manager
Class AgreementsManager
- java.lang.Object
-
- com.oceanprotocol.squid.manager.BaseManager
-
- com.oceanprotocol.squid.manager.AgreementsManager
-
public class AgreementsManager extends BaseManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.oceanprotocol.squid.manager.BaseManager
BaseManager.ContractAddresses
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.logging.log4j.Logger
log
-
Fields inherited from class com.oceanprotocol.squid.manager.BaseManager
accessSecretStoreCondition, agreementStoreManager, conditionStoreManager, config, contractAddresses, didRegistry, dispenser, escrowAccessSecretStoreTemplate, escrowReward, lockRewardCondition, mainAccount, providerAddress, templateStoreManager, tokenContract
-
-
Constructor Summary
Constructors Constructor Description AgreementsManager(KeeperService keeperService, AquariusService aquariusService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
createAgreement(String agreementId, DDO ddo, List<byte[]> conditionIds, String accessConsumer, String signature, AccessService accessService)
Create an agreement using the escrowAccessSecretStoreTemplate.Agreement
getAgreement(String agreementId)
Retrieve the agreement for a agreement_id.private String
getConditionNameByAddress(String address)
Auxiliar method to get the name of the different conditions address.static AgreementsManager
getInstance(KeeperService keeperService, AquariusService aquariusService)
Given the KeeperService and AquariusService, returns a new instance of AgreementsManager using them as attributesAgreementStatus
getStatus(String agreementId)
Get the status of a service agreement.-
Methods inherited from class com.oceanprotocol.squid.manager.BaseManager
buildDDO, buildDDO, getAccessSecretStoreCondition, getAquariusService, getContractAddresses, getEscrowReward, getEvmDto, getKeeperService, getLockRewardCondition, getMainAccount, getMetadataFiles, getProviderAddress, getSecretStoreDto, getSecretStoreManager, setAccessSecretStoreCondition, setAgreementStoreManagerContract, setAquariusService, setConditionStoreManagerContract, setDidRegistryContract, setDispenserContract, setEscrowAccessSecretStoreTemplate, setEscrowReward, setEvmDto, setKeeperService, setLockRewardCondition, setMainAccount, setProviderAddress, setSecretStoreDto, setSecretStoreManager, setTemplateStoreManagerContract, setTokenContract, toString
-
-
-
-
Constructor Detail
-
AgreementsManager
public AgreementsManager(KeeperService keeperService, AquariusService aquariusService)
-
-
Method Detail
-
getInstance
public static AgreementsManager getInstance(KeeperService keeperService, AquariusService aquariusService)
Given the KeeperService and AquariusService, returns a new instance of AgreementsManager using them as attributes- Parameters:
keeperService
- Keeper DtoaquariusService
- Provider Dto- Returns:
- AgreementsManager
-
createAgreement
public Boolean createAgreement(String agreementId, DDO ddo, List<byte[]> conditionIds, String accessConsumer, String signature, AccessService accessService) throws Exception
Create an agreement using the escrowAccessSecretStoreTemplate. This method should be more specific in the future when we have more than one template.- Parameters:
agreementId
- the agreement idddo
- the ddoconditionIds
- list with the conditions idsaccessConsumer
- eth address of the consumer of the agreement.signature
- the signatureaccessService
- an instance of accessService- Returns:
- a flag that is true if the agreement was successfully created.
- Throws:
Exception
- exception
-
getAgreement
public Agreement getAgreement(String agreementId) throws Exception
Retrieve the agreement for a agreement_id.- Parameters:
agreementId
- id of the agreement- Returns:
- Agreement
- Throws:
Exception
- Exception
-
getStatus
public AgreementStatus getStatus(String agreementId) throws Exception
Get the status of a service agreement.- Parameters:
agreementId
- id of the agreement- Returns:
- AgreementStatus with condition status of each of the agreement's conditions.
- Throws:
Exception
- Exception
-
-