Class CachedAccountStorage

    • Constructor Detail

      • CachedAccountStorage

        public CachedAccountStorage​(org.exoplatform.services.cache.CacheService cacheService,
                                    WalletAccountDAO walletAccountDAO,
                                    WalletPrivateKeyDAO privateKeyDAO,
                                    WalletBlockchainStateDAO blockchainStateDAO,
                                    org.exoplatform.web.security.codec.CodecInitializer codecInitializer)
    • Method Detail

      • getWalletByAddress

        public org.exoplatform.wallet.model.Wallet getWalletByAddress​(String address,
                                                                      String contractAddress)
        Overrides:
        getWalletByAddress in class WalletStorage
        Parameters:
        address - wallet address
        contractAddress - contract address to use for wallet blockchain state
        Returns:
        Wallet details identified by address
      • getWalletByIdentityId

        public org.exoplatform.wallet.model.Wallet getWalletByIdentityId​(long identityId,
                                                                         String contractAddress)
        Overrides:
        getWalletByIdentityId in class WalletStorage
        Parameters:
        identityId - user/space technical identty id
        contractAddress - contract address to use for wallet blockchain state
        Returns:
        Wallet details for identity
      • saveWalletBackupState

        public org.exoplatform.wallet.model.Wallet saveWalletBackupState​(long identityId,
                                                                         boolean backupState)
        Description copied from class: WalletStorage
        Change wallet backup state
        Overrides:
        saveWalletBackupState in class WalletStorage
        Parameters:
        identityId - user/space technical identty id
        backupState - true if backedUp else false
        Returns:
        modified Wallet
      • saveWallet

        public org.exoplatform.wallet.model.Wallet saveWallet​(org.exoplatform.wallet.model.Wallet wallet,
                                                              boolean isNew)
        Overrides:
        saveWallet in class WalletStorage
        Parameters:
        wallet - wallet details to save
        isNew - whether this is a new wallet association or not
        Returns:
        saved wallet entity
      • saveWalletBlockchainState

        public void saveWalletBlockchainState​(org.exoplatform.wallet.model.Wallet wallet,
                                              String contractAddress)
        Description copied from class: WalletStorage
        Save wallet state in blockchain
        Overrides:
        saveWalletBlockchainState in class WalletStorage
        Parameters:
        wallet - wallet to save its state
        contractAddress - address of the contract on which the state is associated
      • removeWallet

        public org.exoplatform.wallet.model.Wallet removeWallet​(long identityId)
        Description copied from class: WalletStorage
        Removes a wallet identitied by user/space identity technical id
        Overrides:
        removeWallet in class WalletStorage
        Parameters:
        identityId - user/space technical identty id
        Returns:
        removed Wallet
      • removeWalletPrivateKey

        public void removeWalletPrivateKey​(long walletId)
        Description copied from class: WalletStorage
        Remove Wallet encoded private key by wallet identifier
        Overrides:
        removeWalletPrivateKey in class WalletStorage
        Parameters:
        walletId - wallet unique identifier that is equals to identity ID
      • saveWalletPrivateKey

        public void saveWalletPrivateKey​(long walletId,
                                         String content)
        Description copied from class: WalletStorage
        Save wallet private key
        Overrides:
        saveWalletPrivateKey in class WalletStorage
        Parameters:
        walletId - wallet unique identifier that is equals to identity ID
        content - private key content
      • clearCache

        public void clearCache()