Package io.keyko.nevermined.manager
Class BaseManager
- java.lang.Object
-
- io.keyko.nevermined.manager.BaseManager
-
- Direct Known Subclasses:
AccountsManager
,AgreementsManager
,AssetsManager
,ConditionsManager
,NeverminedManager
,TemplatesManager
public abstract class BaseManager extends Object
Abstract class for the Managers
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseManager.ContractAddresses
-
Field Summary
Fields Modifier and Type Field Description protected io.keyko.nevermined.contracts.AccessSecretStoreCondition
accessSecretStoreCondition
protected io.keyko.nevermined.contracts.AgreementStoreManager
agreementStoreManager
protected io.keyko.nevermined.contracts.ComputeExecutionCondition
computeExecutionCondition
protected io.keyko.nevermined.contracts.Condition
condition
protected io.keyko.nevermined.contracts.ConditionStoreManager
conditionStoreManager
protected com.typesafe.config.Config
config
protected BaseManager.ContractAddresses
contractAddresses
protected io.keyko.nevermined.contracts.DIDRegistry
didRegistry
protected io.keyko.nevermined.contracts.Dispenser
dispenser
protected io.keyko.nevermined.contracts.EscrowAccessSecretStoreTemplate
escrowAccessSecretStoreTemplate
protected io.keyko.nevermined.contracts.EscrowComputeExecutionTemplate
escrowComputeExecutionTemplate
protected io.keyko.nevermined.contracts.EscrowReward
escrowReward
private com.oceanprotocol.secretstore.core.EvmDto
evmDto
private io.keyko.common.web3.KeeperService
keeperService
protected io.keyko.nevermined.contracts.LockRewardCondition
lockRewardCondition
protected static org.apache.logging.log4j.Logger
log
protected Account
mainAccount
private static int
MAX_SS_RETRIES
private MetadataApiService
metadataApiService
protected String
providerAddress
private com.oceanprotocol.secretstore.core.SecretStoreDto
secretStoreDto
private SecretStoreManager
secretStoreManager
private static long
SS_DECRYPTION_SLEEP
protected io.keyko.nevermined.contracts.TemplateStoreManager
templateStoreManager
protected io.keyko.nevermined.contracts.OceanToken
tokenContract
-
Constructor Summary
Constructors Constructor Description BaseManager(io.keyko.common.web3.KeeperService keeperService, MetadataApiService metadataApiService)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DDO
buildDDO(MetadataService metadataService, String address)
io.keyko.nevermined.contracts.AccessSecretStoreCondition
getAccessSecretStoreCondition()
It gets the AccessSecretStoreCondition stub instanceio.keyko.nevermined.contracts.ComputeExecutionCondition
getComputeExecutionCondition()
It gets the ComputeExecutionCondition stub instanceBaseManager.ContractAddresses
getContractAddresses()
List<AssetMetadata.File>
getDecriptedSecretStoreMetadataFiles(DDO ddo)
List<AssetMetadata.File>
getDecriptedSecretStoreMetadataFiles(DDO ddo, int retries)
io.keyko.nevermined.contracts.EscrowComputeExecutionTemplate
getEscrowComputeExecutionTemplate()
It gets the EscrowComputeExecutionTemplate stub instanceio.keyko.nevermined.contracts.EscrowReward
getEscrowReward()
It gets the EscrowReward stub instancecom.oceanprotocol.secretstore.core.EvmDto
getEvmDto()
Get the EvmDtoio.keyko.common.web3.KeeperService
getKeeperService()
Get the KeeperServiceio.keyko.nevermined.contracts.LockRewardCondition
getLockRewardCondition()
It gets the lockRewardCondition stub instanceAccount
getMainAccount()
MetadataApiService
getMetadataApiService()
Get the MetadataApiServiceString
getProviderAddress()
com.oceanprotocol.secretstore.core.SecretStoreDto
getSecretStoreDto()
Get the SecretStoreDtoprivate SecretStoreManager
getSecretStoreInstance(AuthorizationService authorizationService)
SecretStoreManager
getSecretStoreManager()
Get the SecretStoreManagerbyte[]
getTemplateIdByName(String contractName)
DDO
resolveDID(DID did)
Given a DID, scans the DIDRegistry events on-chain to resolve the Metadata API url and return the DDO foundBaseManager
setAccessSecretStoreCondition(io.keyko.nevermined.contracts.AccessSecretStoreCondition accessSecretStoreCondition)
It sets the EscrowReward instanceBaseManager
setAgreementStoreManagerContract(io.keyko.nevermined.contracts.AgreementStoreManager contract)
It sets the AgreementStoreManager stub instanceBaseManager
setComputeExecutionCondition(io.keyko.nevermined.contracts.ComputeExecutionCondition computeExecutionCondition)
It sets the ComputeExecutionCondition instanceBaseManager
setConditionStoreManagerContract(io.keyko.nevermined.contracts.ConditionStoreManager contract)
It sets the AgreementStoreManager stub instanceBaseManager
setDidRegistryContract(io.keyko.nevermined.contracts.DIDRegistry contract)
It sets the DIDRegistry stub instanceBaseManager
setDispenserContract(io.keyko.nevermined.contracts.Dispenser contract)
It sets the Dispenser stub instanceBaseManager
setEscrowAccessSecretStoreTemplate(io.keyko.nevermined.contracts.EscrowAccessSecretStoreTemplate contract)
It sets the EscrowAccessSecretStoreTemplate stub instanceBaseManager
setEscrowComputeExecutionTemplate(io.keyko.nevermined.contracts.EscrowComputeExecutionTemplate escrowComputeExecutionTemplate)
It sets the EscrowComputeExecutionTemplate instanceBaseManager
setEscrowReward(io.keyko.nevermined.contracts.EscrowReward escrowReward)
It sets the EscrowReward instanceBaseManager
setEvmDto(com.oceanprotocol.secretstore.core.EvmDto evmDto)
Set the EvmDto necessary to stablish the encryption/decryption flow necessary by Secret StoreBaseManager
setKeeperService(io.keyko.common.web3.KeeperService keeperService)
Set the KeeperServiceBaseManager
setLockRewardCondition(io.keyko.nevermined.contracts.LockRewardCondition lockRewardCondition)
It sets the LockRewardCondition instanceBaseManager
setMainAccount(Account mainAccount)
BaseManager
setMetadataApiService(MetadataApiService metadataApiService)
Set the MetadataApiServiceBaseManager
setProviderAddress(String providerAddress)
BaseManager
setSecretStoreDto(com.oceanprotocol.secretstore.core.SecretStoreDto secretStoreDto)
Set the SecretStoreDtoBaseManager
setSecretStoreManager(SecretStoreManager secretStoreManager)
Set the SecretStoreManagerBaseManager
setTemplateStoreManagerContract(io.keyko.nevermined.contracts.TemplateStoreManager contract)
It sets the OceanToken stub instanceBaseManager
setTokenContract(io.keyko.nevermined.contracts.OceanToken contract)
It sets the OceanToken stub instanceboolean
tokenApprove(io.keyko.nevermined.contracts.OceanToken tokenContract, String spenderAddress, String price)
String
toString()
-
-
-
Field Detail
-
log
protected static final org.apache.logging.log4j.Logger log
-
MAX_SS_RETRIES
private static final int MAX_SS_RETRIES
- See Also:
- Constant Field Values
-
SS_DECRYPTION_SLEEP
private static final long SS_DECRYPTION_SLEEP
- See Also:
- Constant Field Values
-
keeperService
private io.keyko.common.web3.KeeperService keeperService
-
metadataApiService
private MetadataApiService metadataApiService
-
secretStoreDto
private com.oceanprotocol.secretstore.core.SecretStoreDto secretStoreDto
-
evmDto
private com.oceanprotocol.secretstore.core.EvmDto evmDto
-
secretStoreManager
private SecretStoreManager secretStoreManager
-
tokenContract
protected io.keyko.nevermined.contracts.OceanToken tokenContract
-
dispenser
protected io.keyko.nevermined.contracts.Dispenser dispenser
-
didRegistry
protected io.keyko.nevermined.contracts.DIDRegistry didRegistry
-
lockRewardCondition
protected io.keyko.nevermined.contracts.LockRewardCondition lockRewardCondition
-
escrowReward
protected io.keyko.nevermined.contracts.EscrowReward escrowReward
-
accessSecretStoreCondition
protected io.keyko.nevermined.contracts.AccessSecretStoreCondition accessSecretStoreCondition
-
templateStoreManager
protected io.keyko.nevermined.contracts.TemplateStoreManager templateStoreManager
-
escrowAccessSecretStoreTemplate
protected io.keyko.nevermined.contracts.EscrowAccessSecretStoreTemplate escrowAccessSecretStoreTemplate
-
agreementStoreManager
protected io.keyko.nevermined.contracts.AgreementStoreManager agreementStoreManager
-
conditionStoreManager
protected io.keyko.nevermined.contracts.ConditionStoreManager conditionStoreManager
-
computeExecutionCondition
protected io.keyko.nevermined.contracts.ComputeExecutionCondition computeExecutionCondition
-
escrowComputeExecutionTemplate
protected io.keyko.nevermined.contracts.EscrowComputeExecutionTemplate escrowComputeExecutionTemplate
-
condition
protected io.keyko.nevermined.contracts.Condition condition
-
contractAddresses
protected BaseManager.ContractAddresses contractAddresses
-
config
protected com.typesafe.config.Config config
-
mainAccount
protected Account mainAccount
-
providerAddress
protected String providerAddress
-
-
Constructor Detail
-
BaseManager
public BaseManager(io.keyko.common.web3.KeeperService keeperService, MetadataApiService metadataApiService)
Constructor- Parameters:
keeperService
- KeeperServicemetadataApiService
- MetadataApiService
-
-
Method Detail
-
getSecretStoreInstance
private SecretStoreManager getSecretStoreInstance(AuthorizationService authorizationService)
-
buildDDO
protected DDO buildDDO(MetadataService metadataService, String address) throws DDOException
- Throws:
DDOException
-
getDecriptedSecretStoreMetadataFiles
public List<AssetMetadata.File> getDecriptedSecretStoreMetadataFiles(DDO ddo) throws IOException, EncryptionException, InterruptedException
-
getDecriptedSecretStoreMetadataFiles
public List<AssetMetadata.File> getDecriptedSecretStoreMetadataFiles(DDO ddo, int retries) throws IOException, EncryptionException, InterruptedException
-
tokenApprove
public boolean tokenApprove(io.keyko.nevermined.contracts.OceanToken tokenContract, String spenderAddress, String price) throws TokenApproveException
- Throws:
TokenApproveException
-
resolveDID
public DDO resolveDID(DID did) throws DDOException
Given a DID, scans the DIDRegistry events on-chain to resolve the Metadata API url and return the DDO found- Parameters:
did
- the did- Returns:
- DDO
- Throws:
DDOException
- DDOException
-
getContractAddresses
public BaseManager.ContractAddresses getContractAddresses()
-
getKeeperService
public io.keyko.common.web3.KeeperService getKeeperService()
Get the KeeperService- Returns:
- KeeperService
-
setKeeperService
public BaseManager setKeeperService(io.keyko.common.web3.KeeperService keeperService)
Set the KeeperService- Parameters:
keeperService
- KeeperService- Returns:
- this
-
getMetadataApiService
public MetadataApiService getMetadataApiService()
Get the MetadataApiService- Returns:
- MetadataApiService
-
setMetadataApiService
public BaseManager setMetadataApiService(MetadataApiService metadataApiService)
Set the MetadataApiService- Parameters:
metadataApiService
- MetadataApiService- Returns:
- this
-
getSecretStoreDto
public com.oceanprotocol.secretstore.core.SecretStoreDto getSecretStoreDto()
Get the SecretStoreDto- Returns:
- SecretStoreDto
-
setSecretStoreDto
public BaseManager setSecretStoreDto(com.oceanprotocol.secretstore.core.SecretStoreDto secretStoreDto)
Set the SecretStoreDto- Parameters:
secretStoreDto
- SecretStoreDto- Returns:
- this
-
getSecretStoreManager
public SecretStoreManager getSecretStoreManager()
Get the SecretStoreManager- Returns:
- SecretStoreDto
-
setSecretStoreManager
public BaseManager setSecretStoreManager(SecretStoreManager secretStoreManager)
Set the SecretStoreManager- Parameters:
secretStoreManager
- SecretStoreDto- Returns:
- this
-
getEvmDto
public com.oceanprotocol.secretstore.core.EvmDto getEvmDto()
Get the EvmDto- Returns:
- EvmDto
-
setEvmDto
public BaseManager setEvmDto(com.oceanprotocol.secretstore.core.EvmDto evmDto)
Set the EvmDto necessary to stablish the encryption/decryption flow necessary by Secret Store- Parameters:
evmDto
- EvmDto- Returns:
- this
-
setTokenContract
public BaseManager setTokenContract(io.keyko.nevermined.contracts.OceanToken contract)
It sets the OceanToken stub instance- Parameters:
contract
- OceanToken instance- Returns:
- BaseManager instance
-
setTemplateStoreManagerContract
public BaseManager setTemplateStoreManagerContract(io.keyko.nevermined.contracts.TemplateStoreManager contract)
It sets the OceanToken stub instance- Parameters:
contract
- OceanToken instance- Returns:
- BaseManager instance
-
setDispenserContract
public BaseManager setDispenserContract(io.keyko.nevermined.contracts.Dispenser contract)
It sets the Dispenser stub instance- Parameters:
contract
- Dispenser instance- Returns:
- BaseManager instance
-
setEscrowAccessSecretStoreTemplate
public BaseManager setEscrowAccessSecretStoreTemplate(io.keyko.nevermined.contracts.EscrowAccessSecretStoreTemplate contract)
It sets the EscrowAccessSecretStoreTemplate stub instance- Parameters:
contract
- EscrowAccessSecretStoreTemplate instance- Returns:
- BaseManager instance
-
setDidRegistryContract
public BaseManager setDidRegistryContract(io.keyko.nevermined.contracts.DIDRegistry contract)
It sets the DIDRegistry stub instance- Parameters:
contract
- DIDRegistry instance- Returns:
- BaseManager instance
-
setAgreementStoreManagerContract
public BaseManager setAgreementStoreManagerContract(io.keyko.nevermined.contracts.AgreementStoreManager contract)
It sets the AgreementStoreManager stub instance- Parameters:
contract
- AgreementStoreManager instance- Returns:
- BaseManager instance
-
setConditionStoreManagerContract
public BaseManager setConditionStoreManagerContract(io.keyko.nevermined.contracts.ConditionStoreManager contract)
It sets the AgreementStoreManager stub instance- Parameters:
contract
- AgreementStoreManager instance- Returns:
- BaseManager instance
-
getLockRewardCondition
public io.keyko.nevermined.contracts.LockRewardCondition getLockRewardCondition()
It gets the lockRewardCondition stub instance- Returns:
- LockRewardCondition instance
-
setLockRewardCondition
public BaseManager setLockRewardCondition(io.keyko.nevermined.contracts.LockRewardCondition lockRewardCondition)
It sets the LockRewardCondition instance- Parameters:
lockRewardCondition
- instance- Returns:
- BaseManager instance
-
getEscrowReward
public io.keyko.nevermined.contracts.EscrowReward getEscrowReward()
It gets the EscrowReward stub instance- Returns:
- EscrowReward instance
-
setEscrowReward
public BaseManager setEscrowReward(io.keyko.nevermined.contracts.EscrowReward escrowReward)
It sets the EscrowReward instance- Parameters:
escrowReward
- EscrowReward instance- Returns:
- BaseManager instance
-
getComputeExecutionCondition
public io.keyko.nevermined.contracts.ComputeExecutionCondition getComputeExecutionCondition()
It gets the ComputeExecutionCondition stub instance- Returns:
- ComputeExecutionCondition instance
-
setComputeExecutionCondition
public BaseManager setComputeExecutionCondition(io.keyko.nevermined.contracts.ComputeExecutionCondition computeExecutionCondition)
It sets the ComputeExecutionCondition instance- Parameters:
computeExecutionCondition
- ComputeExecutionCondition instance- Returns:
- BaseManager instance
-
getEscrowComputeExecutionTemplate
public io.keyko.nevermined.contracts.EscrowComputeExecutionTemplate getEscrowComputeExecutionTemplate()
It gets the EscrowComputeExecutionTemplate stub instance- Returns:
- EscrowComputeExecutionTemplate instance
-
setEscrowComputeExecutionTemplate
public BaseManager setEscrowComputeExecutionTemplate(io.keyko.nevermined.contracts.EscrowComputeExecutionTemplate escrowComputeExecutionTemplate)
It sets the EscrowComputeExecutionTemplate instance- Parameters:
escrowComputeExecutionTemplate
- EscrowComputeExecutionTemplate instance- Returns:
- BaseManager instance
-
getAccessSecretStoreCondition
public io.keyko.nevermined.contracts.AccessSecretStoreCondition getAccessSecretStoreCondition()
It gets the AccessSecretStoreCondition stub instance- Returns:
- AccessSecretStoreCondition instance
-
setAccessSecretStoreCondition
public BaseManager setAccessSecretStoreCondition(io.keyko.nevermined.contracts.AccessSecretStoreCondition accessSecretStoreCondition)
It sets the EscrowReward instance- Parameters:
accessSecretStoreCondition
- AccessSecretStoreCondition instance- Returns:
- BaseManager instance
-
getMainAccount
public Account getMainAccount()
-
setMainAccount
public BaseManager setMainAccount(Account mainAccount)
-
getProviderAddress
public String getProviderAddress()
-
setProviderAddress
public BaseManager setProviderAddress(String providerAddress)
-
getTemplateIdByName
public byte[] getTemplateIdByName(String contractName)
-
-