Package com.oceanprotocol.squid.manager
Class TemplatesManager
- java.lang.Object
-
- com.oceanprotocol.squid.manager.BaseManager
-
- com.oceanprotocol.squid.manager.TemplatesManager
-
public class TemplatesManager extends BaseManager
Controller class to manage the SEA Template functions
-
-
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 Modifier Constructor Description private
TemplatesManager(KeeperService keeperService, AquariusService aquariusService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.web3j.protocol.core.methods.response.TransactionReceipt
approveTemplate(String templateAddress)
Approve (whitelist) an already proposed templatestatic TemplatesManager
getInstance(KeeperService keeperService, AquariusService aquariusService)
Given the KeeperService and AquariusService, returns a new instance of AccountsManager using them as attributesTemplateSEA
getTemplate(String templateAddress)
Getting template using an address givenBigInteger
getTemplateListSize()
Returns the number of templates registeredboolean
isTemplateApproved(String templateAddress)
Returns true or false depending if the template was approvedorg.web3j.protocol.core.methods.response.TransactionReceipt
proposeTemplate(String templateAddress)
Suggest an agreement template smart contract to include in the white listed agreement templatesorg.web3j.protocol.core.methods.response.TransactionReceipt
revokeTemplate(String templateAddress)
Cancel the propsed/approved template or essentially de-whitelist the template.-
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
-
TemplatesManager
private TemplatesManager(KeeperService keeperService, AquariusService aquariusService)
-
-
Method Detail
-
getInstance
public static TemplatesManager getInstance(KeeperService keeperService, AquariusService aquariusService)
Given the KeeperService and AquariusService, returns a new instance of AccountsManager using them as attributes- Parameters:
keeperService
- Keeper DtoaquariusService
- Provider Dto- Returns:
- AccountsManager AccountsManager instance
-
proposeTemplate
public org.web3j.protocol.core.methods.response.TransactionReceipt proposeTemplate(String templateAddress) throws EthereumException
Suggest an agreement template smart contract to include in the white listed agreement templates- Parameters:
templateAddress
- Hex str the ethereum address of the deployed template (smart contract address)- Returns:
- TransactionReceipt tx receipt
- Throws:
EthereumException
- EVM error
-
approveTemplate
public org.web3j.protocol.core.methods.response.TransactionReceipt approveTemplate(String templateAddress) throws EthereumException
Approve (whitelist) an already proposed template- Parameters:
templateAddress
- Hex str the ethereum address of the deployed template (smart contract address)- Returns:
- TransactionReceipt tx receipt
- Throws:
EthereumException
- EVM error
-
revokeTemplate
public org.web3j.protocol.core.methods.response.TransactionReceipt revokeTemplate(String templateAddress) throws EthereumException
Cancel the propsed/approved template or essentially de-whitelist the template.- Parameters:
templateAddress
- Hex str the ethereum address of the deployed template (smart contract address)- Returns:
- TransactionReceipt tx receipt
- Throws:
EthereumException
- EVM error
-
isTemplateApproved
public boolean isTemplateApproved(String templateAddress) throws EthereumException
Returns true or false depending if the template was approved- Parameters:
templateAddress
- Hex str the ethereum address of the deployed template (smart contract address)- Returns:
- boolean is approved
- Throws:
EthereumException
- EVM error
-
getTemplateListSize
public BigInteger getTemplateListSize() throws EthereumException
Returns the number of templates registered- Returns:
- boolean is approved
- Throws:
EthereumException
- EVM error
-
getTemplate
public TemplateSEA getTemplate(String templateAddress) throws EthereumException
Getting template using an address given- Parameters:
templateAddress
- template address- Returns:
- TemplateSEA instance
- Throws:
EthereumException
- EVM error
-
-