Class CachedAccountStorage
- java.lang.Object
-
- org.exoplatform.wallet.storage.WalletStorage
-
- org.exoplatform.wallet.storage.cached.CachedAccountStorage
-
public class CachedAccountStorage extends WalletStorage
-
-
Constructor Summary
Constructors Constructor Description CachedAccountStorage(org.exoplatform.services.cache.CacheService cacheService, WalletAccountDAO walletAccountDAO, WalletPrivateKeyDAO privateKeyDAO, WalletBlockchainStateDAO blockchainStateDAO, org.exoplatform.web.security.codec.CodecInitializer codecInitializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()org.exoplatform.wallet.model.WalletgetWalletByAddress(String address, String contractAddress)org.exoplatform.wallet.model.WalletgetWalletByIdentityId(long identityId, String contractAddress)org.exoplatform.wallet.model.WalletremoveWallet(long identityId)Removes a wallet identitied by user/space identity technical idvoidremoveWalletPrivateKey(long walletId)Remove Wallet encoded private key by wallet identifierorg.exoplatform.wallet.model.WalletsaveWallet(org.exoplatform.wallet.model.Wallet wallet, boolean isNew)org.exoplatform.wallet.model.WalletsaveWalletBackupState(long identityId, boolean backupState)Change wallet backup statevoidsaveWalletBlockchainState(org.exoplatform.wallet.model.Wallet wallet, String contractAddress)Save wallet state in blockchainvoidsaveWalletPrivateKey(long walletId, String content)Save wallet private key-
Methods inherited from class org.exoplatform.wallet.storage.WalletStorage
getWalletPrivateKey, getWalletsCount, listWallets, retrieveWalletBlockchainState
-
-
-
-
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:
getWalletByAddressin classWalletStorage- Parameters:
address- wallet addresscontractAddress- contract address to use for wallet blockchain state- Returns:
Walletdetails identified by address
-
getWalletByIdentityId
public org.exoplatform.wallet.model.Wallet getWalletByIdentityId(long identityId, String contractAddress)- Overrides:
getWalletByIdentityIdin classWalletStorage- Parameters:
identityId- user/space technical identty idcontractAddress- contract address to use for wallet blockchain state- Returns:
Walletdetails for identity
-
saveWalletBackupState
public org.exoplatform.wallet.model.Wallet saveWalletBackupState(long identityId, boolean backupState)Description copied from class:WalletStorageChange wallet backup state- Overrides:
saveWalletBackupStatein classWalletStorage- Parameters:
identityId- user/space technical identty idbackupState- 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:
saveWalletin classWalletStorage- Parameters:
wallet- wallet details to saveisNew- 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:WalletStorageSave wallet state in blockchain- Overrides:
saveWalletBlockchainStatein classWalletStorage- Parameters:
wallet- wallet to save its statecontractAddress- address of the contract on which the state is associated
-
removeWallet
public org.exoplatform.wallet.model.Wallet removeWallet(long identityId)
Description copied from class:WalletStorageRemoves a wallet identitied by user/space identity technical id- Overrides:
removeWalletin classWalletStorage- Parameters:
identityId- user/space technical identty id- Returns:
- removed
Wallet
-
removeWalletPrivateKey
public void removeWalletPrivateKey(long walletId)
Description copied from class:WalletStorageRemove Wallet encoded private key by wallet identifier- Overrides:
removeWalletPrivateKeyin classWalletStorage- Parameters:
walletId- wallet unique identifier that is equals to identity ID
-
saveWalletPrivateKey
public void saveWalletPrivateKey(long walletId, String content)Description copied from class:WalletStorageSave wallet private key- Overrides:
saveWalletPrivateKeyin classWalletStorage- Parameters:
walletId- wallet unique identifier that is equals to identity IDcontent- private key content
-
clearCache
public void clearCache()
-
-