Class MongoSmartContractDao
java.lang.Object
dev.getelements.elements.dao.mongo.blockchain.MongoSmartContractDao
- All Implemented Interfaces:
SmartContractDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSmartContract
(SmartContract smartContract) Creates aSmartContract
in the database.void
deleteContract
(String contractId) Deletes aSmartContract
.findSmartContractById
(String contractNameOrId) Finds a specificSmartContract
.findSmartContractByNameOrId
(String contractNameOrId) Finds a specificSmartContract
.dev.morphia.Datastore
getSmartContracts
(int offset, int count, BlockchainApi blockchainApi, List<BlockchainNetwork> blockchainNetworks) Gets the smart contracts in the database.void
setDatastore
(dev.morphia.Datastore datastore) void
setMapper
(MapperRegistry mapperRegistry) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoVaultDao
(MongoVaultDao mongoVaultDao) void
setValidationHelper
(ValidationHelper validationHelper) updateSmartContract
(SmartContract smartContract) Updates aSmartContract
in the database.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.dao.SmartContractDao
getSmartContractById, getSmartContractByNameOrId, getSmartContractsForSingleNetwork
-
Constructor Details
-
MongoSmartContractDao
public MongoSmartContractDao()
-
-
Method Details
-
getSmartContracts
public Pagination<SmartContract> getSmartContracts(int offset, int count, BlockchainApi blockchainApi, List<BlockchainNetwork> blockchainNetworks) Description copied from interface:SmartContractDao
Gets the smart contracts in the database.- Specified by:
getSmartContracts
in interfaceSmartContractDao
- Parameters:
offset
- the offsetcount
- the countblockchainApi
- the blockchain API, or nullblockchainNetworks
- the networks associated, or null- Returns:
- a
Pagination<SmartContract>
-
findSmartContractById
Description copied from interface:SmartContractDao
Finds a specificSmartContract
.- Specified by:
findSmartContractById
in interfaceSmartContractDao
- Parameters:
contractNameOrId
-- Returns:
- the
Optional<SmartContract>
-
findSmartContractByNameOrId
Description copied from interface:SmartContractDao
Finds a specificSmartContract
.- Specified by:
findSmartContractByNameOrId
in interfaceSmartContractDao
- Parameters:
contractNameOrId
- the contract unique name or id- Returns:
- the
Optional<SmartContract>
-
updateSmartContract
Description copied from interface:SmartContractDao
Updates aSmartContract
in the database.- Specified by:
updateSmartContract
in interfaceSmartContractDao
- Parameters:
smartContract
- theSmartContract
- Returns:
- the
SmartContract
-
createSmartContract
Description copied from interface:SmartContractDao
Creates aSmartContract
in the database.- Specified by:
createSmartContract
in interfaceSmartContractDao
- Parameters:
smartContract
- theSmartContract
- Returns:
- the
SmartContract
-
deleteContract
Description copied from interface:SmartContractDao
Deletes aSmartContract
.- Specified by:
deleteContract
in interfaceSmartContractDao
- Parameters:
contractId
- the contract ID.
-
getMapper
-
setMapper
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMongoDBUtils
-
setMongoDBUtils
-
getValidationHelper
-
setValidationHelper
-
getMongoVaultDao
-
setMongoVaultDao
-