Package io.keyko.nevermined.manager
Class TemplatesManager
- java.lang.Object
-
- io.keyko.nevermined.manager.BaseManager
-
- io.keyko.nevermined.manager.TemplatesManager
-
public class TemplatesManager extends BaseManager
Controller class to manage the SEA Template functions
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.keyko.nevermined.manager.BaseManager
BaseManager.ContractAddresses
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.logging.log4j.Loggerlog-
Fields inherited from class io.keyko.nevermined.manager.BaseManager
accessSecretStoreCondition, agreementStoreManager, computeExecutionCondition, condition, conditionStoreManager, config, contractAddresses, didRegistry, dispenser, escrowAccessSecretStoreTemplate, escrowComputeExecutionTemplate, escrowReward, lockRewardCondition, mainAccount, providerAddress, templateStoreManager, tokenContract
-
-
Constructor Summary
Constructors Modifier Constructor Description privateTemplatesManager(io.keyko.common.web3.KeeperService keeperService, MetadataApiService metadataApiService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.web3j.protocol.core.methods.response.TransactionReceiptapproveTemplate(String templateId)Approve (whitelist) an already proposed templatestatic TemplatesManagergetInstance(io.keyko.common.web3.KeeperService keeperService, MetadataApiService metadataApiService)Given the KeeperService and MetadataApiService, returns a new instance of AccountsManager using them as attributesTemplateSEAgetTemplate(String templateId)Getting template using an address givenBigIntegergetTemplateListSize()Returns the number of templates registeredbooleanisTemplateApproved(String templateAddress)Returns true or false depending if the template was approvedorg.web3j.protocol.core.methods.response.TransactionReceiptproposeTemplate(String templateAddress)Suggest an agreement template smart contract to include in the white listed agreement templatesorg.web3j.protocol.core.methods.response.TransactionReceiptrevokeTemplate(String templateId)Cancel the propsed/approved template or essentially de-whitelist the template.-
Methods inherited from class io.keyko.nevermined.manager.BaseManager
buildDDO, getAccessSecretStoreCondition, getComputeExecutionCondition, getContractAddresses, getDecriptedSecretStoreMetadataFiles, getDecriptedSecretStoreMetadataFiles, getEscrowComputeExecutionTemplate, getEscrowReward, getEvmDto, getKeeperService, getLockRewardCondition, getMainAccount, getMetadataApiService, getProviderAddress, getSecretStoreDto, getSecretStoreManager, getTemplateIdByName, resolveDID, setAccessSecretStoreCondition, setAgreementStoreManagerContract, setComputeExecutionCondition, setConditionStoreManagerContract, setDidRegistryContract, setDispenserContract, setEscrowAccessSecretStoreTemplate, setEscrowComputeExecutionTemplate, setEscrowReward, setEvmDto, setKeeperService, setLockRewardCondition, setMainAccount, setMetadataApiService, setProviderAddress, setSecretStoreDto, setSecretStoreManager, setTemplateStoreManagerContract, setTokenContract, tokenApprove, toString
-
-
-
-
Constructor Detail
-
TemplatesManager
private TemplatesManager(io.keyko.common.web3.KeeperService keeperService, MetadataApiService metadataApiService)
-
-
Method Detail
-
getInstance
public static TemplatesManager getInstance(io.keyko.common.web3.KeeperService keeperService, MetadataApiService metadataApiService)
Given the KeeperService and MetadataApiService, returns a new instance of AccountsManager using them as attributes- Parameters:
keeperService- Keeper DtometadataApiService- 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 templateId) throws EthereumException
Approve (whitelist) an already proposed template- Parameters:
templateId- String- Returns:
- TransactionReceipt tx receipt
- Throws:
EthereumException- EVM error
-
revokeTemplate
public org.web3j.protocol.core.methods.response.TransactionReceipt revokeTemplate(String templateId) throws EthereumException
Cancel the propsed/approved template or essentially de-whitelist the template.- Parameters:
templateId- 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 templateId) throws EthereumException
Getting template using an address given- Parameters:
templateId- template address- Returns:
- TemplateSEA instance
- Throws:
EthereumException- EVM error
-
-