Class CachedAccountStorage

java.lang.Object
org.exoplatform.wallet.storage.WalletStorage
org.exoplatform.wallet.storage.cached.CachedAccountStorage

public class CachedAccountStorage extends WalletStorage
  • Constructor Details

  • Method Details

    • 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) throws org.exoplatform.wallet.model.AddressAlreadyInUseException
      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
      Throws:
      org.exoplatform.wallet.model.AddressAlreadyInUseException - when the address is already used by another wallet
    • switchToInternalWallet

      public void switchToInternalWallet(long walletId)
      Description copied from class: WalletStorage
      Switches Wallet to internal provider and transaction signer
      Overrides:
      switchToInternalWallet in class WalletStorage
      Parameters:
      walletId - Wallet unique identifier
    • switchToWalletProvider

      public void switchToWalletProvider(long walletId, org.exoplatform.wallet.model.WalletProvider provider, String newAddress)
      Description copied from class: WalletStorage
      Switches Wallet to a new wallet provider and transaction signer
      Overrides:
      switchToWalletProvider in class WalletStorage
      Parameters:
      walletId - Wallet unique identifier
      provider - WalletProvider that must be different from Internal Wallet
      newAddress - Selected address provided from new Wallet Provider Tool
    • 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()