Package io.keyko.nevermined.api.impl
Class TemplatesImpl
- java.lang.Object
-
- io.keyko.nevermined.api.impl.TemplatesImpl
-
- All Implemented Interfaces:
TemplatesAPI
public class TemplatesImpl extends Object implements TemplatesAPI
-
-
Field Summary
Fields Modifier and Type Field Description private TemplatesManagertemplatesManager
-
Constructor Summary
Constructors Constructor Description TemplatesImpl(TemplatesManager templatesManager)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.web3j.protocol.core.methods.response.TransactionReceiptapprove(String templateAddress)Approve (whitelist) an already proposed template.BigIntegergetListSize()Get the number of agreement templates registeredTemplateSEAgetTemplate(String templateAddress)Return the attributes associated to a registered Template in the Smart ContractsbooleanisApproved(String templateAddress)Checks if an agreement template is approvedorg.web3j.protocol.core.methods.response.TransactionReceiptpropose(String templateAddress)Suggest an agreement template smart contract to include in the white listed agreement templatesorg.web3j.protocol.core.methods.response.TransactionReceiptrevoke(String templateAddress)Cancel the propsed/approved template or essentially de-whitelist the template.
-
-
-
Field Detail
-
templatesManager
private TemplatesManager templatesManager
-
-
Constructor Detail
-
TemplatesImpl
public TemplatesImpl(TemplatesManager templatesManager)
Constructor- Parameters:
templatesManager- the templatesManager
-
-
Method Detail
-
propose
public org.web3j.protocol.core.methods.response.TransactionReceipt propose(String templateAddress) throws EthereumException
Description copied from interface:TemplatesAPISuggest an agreement template smart contract to include in the white listed agreement templates- Specified by:
proposein interfaceTemplatesAPI- Parameters:
templateAddress- Hex str, typically the Ethereum address of the deployed template (smart contract address)- Returns:
- TransactionReceipt tx receipt
- Throws:
EthereumException- EthereumException
-
approve
public org.web3j.protocol.core.methods.response.TransactionReceipt approve(String templateAddress) throws EthereumException
Description copied from interface:TemplatesAPIApprove (whitelist) an already proposed template. Once a template is approved it can be used for creating agreements in Nevermined network- Specified by:
approvein interfaceTemplatesAPI- Parameters:
templateAddress- Hex str, typically the Ethereum address of the deployed template (smart contract address)- Returns:
- TransactionReceipt tx receipt
- Throws:
EthereumException- EthereumException
-
revoke
public org.web3j.protocol.core.methods.response.TransactionReceipt revoke(String templateAddress) throws EthereumException
Description copied from interface:TemplatesAPICancel the propsed/approved template or essentially de-whitelist the template. This prevents the creation of any further agreements that are based on this template.- Specified by:
revokein interfaceTemplatesAPI- Parameters:
templateAddress- Hex str, typically the Ethereum address of the deployed template (smart contract address)- Returns:
- TransactionReceipt tx receipt
- Throws:
EthereumException- EthereumException
-
isApproved
public boolean isApproved(String templateAddress) throws EthereumException
Description copied from interface:TemplatesAPIChecks if an agreement template is approved- Specified by:
isApprovedin interfaceTemplatesAPI- Parameters:
templateAddress- Hex str the ethereum address of the deployed template (smart contract address)- Returns:
- boolean is the template approved?
- Throws:
EthereumException- EthereumException
-
getListSize
public BigInteger getListSize() throws EthereumException
Description copied from interface:TemplatesAPIGet the number of agreement templates registered- Specified by:
getListSizein interfaceTemplatesAPI- Returns:
- BigInteger number of templates
- Throws:
EthereumException- EthereumException
-
getTemplate
public TemplateSEA getTemplate(String templateAddress) throws EthereumException
Description copied from interface:TemplatesAPIReturn the attributes associated to a registered Template in the Smart Contracts- Specified by:
getTemplatein interfaceTemplatesAPI- Parameters:
templateAddress- Hex str, typically the Ethereum address of the deployed template (smart contract address)- Returns:
- TemplateSEA
- Throws:
EthereumException- EthereumException
-
-