Package com.oceanprotocol.squid.api.impl
Class TemplatesImpl
- java.lang.Object
-
- com.oceanprotocol.squid.api.impl.TemplatesImpl
-
- All Implemented Interfaces:
TemplatesAPI
public class TemplatesImpl extends Object implements TemplatesAPI
-
-
Field Summary
Fields Modifier and Type Field Description private TemplatesManager
templatesManager
-
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.TransactionReceipt
approve(String templateAddress)
Approve (whitelist) an already proposed template.BigInteger
getListSize()
Get the number of agreement templates registeredTemplateSEA
getTemplate(String templateAddress)
Return the attributes associated to a registered Template in the Smart Contractsboolean
isApproved(String templateAddress)
Checks if an agreement template is approvedorg.web3j.protocol.core.methods.response.TransactionReceipt
propose(String templateAddress)
Suggest an agreement template smart contract to include in the white listed agreement templatesorg.web3j.protocol.core.methods.response.TransactionReceipt
revoke(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:TemplatesAPI
Suggest an agreement template smart contract to include in the white listed agreement templates- Specified by:
propose
in interfaceTemplatesAPI
- Parameters:
templateAddress
- Hex str 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:TemplatesAPI
Approve (whitelist) an already proposed template. Once a template is approved it can be used for creating agreements in Ocean Protocol keeper network- Specified by:
approve
in interfaceTemplatesAPI
- Parameters:
templateAddress
- Hex str 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:TemplatesAPI
Cancel 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:
revoke
in interfaceTemplatesAPI
- Parameters:
templateAddress
- Hex str 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:TemplatesAPI
Checks if an agreement template is approved- Specified by:
isApproved
in 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:TemplatesAPI
Get the number of agreement templates registered- Specified by:
getListSize
in interfaceTemplatesAPI
- Returns:
- BigInteger number of templates
- Throws:
EthereumException
- EthereumException
-
getTemplate
public TemplateSEA getTemplate(String templateAddress) throws EthereumException
Description copied from interface:TemplatesAPI
Return the attributes associated to a registered Template in the Smart Contracts- Specified by:
getTemplate
in interfaceTemplatesAPI
- Parameters:
templateAddress
- Hex str the ethereum address of the deployed template (smart contract address)- Returns:
- TemplateSEA
- Throws:
EthereumException
- EthereumException
-
-