Class OceanInitializationHelper


  • public class OceanInitializationHelper
    extends Object
    Helper to initialize all the managers, services and contracts needed for the API
    • Constructor Detail

      • OceanInitializationHelper

        public OceanInitializationHelper​(OceanConfig oceanConfig)
        Constructor
        Parameters:
        oceanConfig - object with the configuration
    • Method Detail

      • getKeeper

        public com.oceanprotocol.common.web3.KeeperService getKeeper()
                                                              throws IOException,
                                                                     org.web3j.crypto.CipherException
        Initialize an instance of KeeperService
        Returns:
        an initialized KeeperService object
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • getAquarius

        public AquariusService getAquarius()
        Initialize an instance of AquariusService
        Returns:
        an initialized AquariusService object
      • getSecretStoreDto

        public com.oceanprotocol.secretstore.core.SecretStoreDto getSecretStoreDto()
        Initialize an instance of SecretStoreDto
        Returns:
        an initializedSecretStoreDto object
      • getEvmDto

        public com.oceanprotocol.secretstore.core.EvmDto getEvmDto()
        Initialize an instance of EvmDto
        Returns:
        an initialized EvmDto object
      • getSecretStoreManager

        public SecretStoreManager getSecretStoreManager​(com.oceanprotocol.secretstore.core.SecretStoreDto secretStoreDto,
                                                        com.oceanprotocol.secretstore.core.EvmDto evmDto)
        Initialize an instance of SecretStoreManager
        Parameters:
        secretStoreDto - the DTO to connect with secret store
        evmDto - DTO with the EVM
        Returns:
        an initialized SecretStoreManager object
      • getOceanManager

        public OceanManager getOceanManager​(com.oceanprotocol.common.web3.KeeperService keeperService,
                                            AquariusService aquariusService)
                                     throws IOException,
                                            org.web3j.crypto.CipherException
        Initialize an instance of OceanManager
        Parameters:
        keeperService - the keeperService
        aquariusService - the aquariusService
        Returns:
        an initialized OceanManager object
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • getAccountsManager

        public AccountsManager getAccountsManager​(com.oceanprotocol.common.web3.KeeperService keeperService,
                                                  AquariusService aquariusService)
                                           throws IOException,
                                                  org.web3j.crypto.CipherException
        Initialize an instance of AccountsManager
        Parameters:
        keeperService - the keeperService
        aquariusService - the AquariusService
        Returns:
        an initialized AccountsManager object
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • getAgreementsManager

        public AgreementsManager getAgreementsManager​(com.oceanprotocol.common.web3.KeeperService keeperService,
                                                      AquariusService aquariusService)
                                               throws IOException,
                                                      org.web3j.crypto.CipherException
        Initialize an instance of AgreementsManager
        Parameters:
        keeperService - the keeperService
        aquariusService - the AquariusService
        Returns:
        an initialized AgreementsManager object
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • getConditionsManager

        public ConditionsManager getConditionsManager​(com.oceanprotocol.common.web3.KeeperService keeperService,
                                                      AquariusService aquariusService)
                                               throws IOException,
                                                      org.web3j.crypto.CipherException
        Initialize an instance of ConditionsManager
        Parameters:
        keeperService - the keeperService
        aquariusService - the AquariusService
        Returns:
        an initialized ConditionsManager object
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • getTemplatesManager

        public TemplatesManager getTemplatesManager​(com.oceanprotocol.common.web3.KeeperService keeperService,
                                                    AquariusService aquariusService)
                                             throws IOException,
                                                    org.web3j.crypto.CipherException
        Initialize an instance of TemplatesManager
        Parameters:
        keeperService - the keeperService
        aquariusService - the AquariusService
        Returns:
        an initialized TemplatesManager object
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • getAssetsManager

        public AssetsManager getAssetsManager​(com.oceanprotocol.common.web3.KeeperService keeperService,
                                              AquariusService aquariusService)
                                       throws IOException,
                                              org.web3j.crypto.CipherException
        Initialize an instance of AssetsManager
        Parameters:
        keeperService - the KeeperService
        aquariusService - the AquariusService
        Returns:
        an initialized AssetsManager object
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadOceanTokenContract

        public com.oceanprotocol.keeper.contracts.OceanToken loadOceanTokenContract​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                             throws IOException,
                                                                                    org.web3j.crypto.CipherException
        Loads the OceanToken contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of OceanToken contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadTemplateStoreManagerContract

        public com.oceanprotocol.keeper.contracts.TemplateStoreManager loadTemplateStoreManagerContract​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                                                 throws IOException,
                                                                                                        org.web3j.crypto.CipherException
        Loads the TemplateStoreManager contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of TemplateStoreManager contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadDispenserContract

        public com.oceanprotocol.keeper.contracts.Dispenser loadDispenserContract​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                           throws IOException,
                                                                                  org.web3j.crypto.CipherException
        Loads the Dispenser contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of Dispenser contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadDIDRegistryContract

        public com.oceanprotocol.keeper.contracts.DIDRegistry loadDIDRegistryContract​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                               throws IOException,
                                                                                      org.web3j.crypto.CipherException
        Loads the DIDRegistry contract from Keeper
        Parameters:
        keeper - the keeper service
        Returns:
        an instance of DIDRegistry contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadEscrowAccessSecretStoreTemplate

        public com.oceanprotocol.keeper.contracts.EscrowAccessSecretStoreTemplate loadEscrowAccessSecretStoreTemplate​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                                                               throws IOException,
                                                                                                                      org.web3j.crypto.CipherException
        Loads the EscrowAccessSecretStoreTemplate contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of EscrowAccessSecretStoreTemplate contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadLockRewardCondition

        public com.oceanprotocol.keeper.contracts.LockRewardCondition loadLockRewardCondition​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                                       throws IOException,
                                                                                              org.web3j.crypto.CipherException
        Loads the LockRewardCondition contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of LockRewardCondition contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadEscrowReward

        public com.oceanprotocol.keeper.contracts.EscrowReward loadEscrowReward​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                         throws IOException,
                                                                                org.web3j.crypto.CipherException
        Loads the EscrowReward contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of EscrowReward contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadAgreementStoreManager

        public com.oceanprotocol.keeper.contracts.AgreementStoreManager loadAgreementStoreManager​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                                           throws IOException,
                                                                                                  org.web3j.crypto.CipherException
        Loads the AgreementStoreManager contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of AgreementStoreManager contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadConditionStoreManager

        public com.oceanprotocol.keeper.contracts.ConditionStoreManager loadConditionStoreManager​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                                           throws IOException,
                                                                                                  org.web3j.crypto.CipherException
        Loads the AgreementStoreManager contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of AgreementStoreManager contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException
      • loadAccessSecretStoreCondition

        public com.oceanprotocol.keeper.contracts.AccessSecretStoreCondition loadAccessSecretStoreCondition​(com.oceanprotocol.common.web3.KeeperService keeper)
                                                                                                     throws IOException,
                                                                                                            org.web3j.crypto.CipherException
        Loads the AccessSecretStoreCondition contract from Keeper
        Parameters:
        keeper - the keeper Service
        Returns:
        an instance of AccessSecretStoreCondition contract deployed in keeper
        Throws:
        IOException - IOException
        org.web3j.crypto.CipherException - CipherException