Package io.meeds.wallet.storage.cached
Class CachedAccountStorage
java.lang.Object
io.meeds.wallet.storage.WalletStorage
io.meeds.wallet.storage.cached.CachedAccountStorage
-
Constructor Summary
ConstructorsConstructorDescriptionCachedAccountStorage(org.exoplatform.services.cache.CacheService cacheService, WalletAccountDAO walletAccountDAO, WalletAccountBackupDAO walletAccountBackupDAO, WalletPrivateKeyDAO privateKeyDAO, WalletBlockchainStateDAO blockchainStateDAO, org.exoplatform.web.security.codec.CodecInitializer codecInitializer) -
Method Summary
Modifier and TypeMethodDescriptionvoidio.meeds.wallet.model.WalletgetWalletByAddress(String address, String contractAddress) io.meeds.wallet.model.WalletgetWalletByIdentityId(long identityId, String contractAddress) io.meeds.wallet.model.WalletremoveWallet(long identityId) Removes a wallet identitied by user/space identity technical idvoidremoveWalletPrivateKey(long walletId) Remove Wallet encoded private key by wallet identifierio.meeds.wallet.model.WalletsaveWallet(io.meeds.wallet.model.Wallet wallet, boolean isNew) io.meeds.wallet.model.WalletsaveWalletBackupState(long identityId, boolean backupState) Change wallet backup statevoidsaveWalletBlockchainState(io.meeds.wallet.model.Wallet wallet, String contractAddress) Save wallet state in blockchainvoidsaveWalletPrivateKey(long walletId, String content) Save wallet private keyvoidswitchToInternalWallet(long walletId) SwitchesWalletto internal provider and transaction signervoidswitchToWalletProvider(long walletId, io.meeds.wallet.model.WalletProvider provider, String newAddress) SwitchesWalletto a new wallet provider and transaction signerMethods inherited from class io.meeds.wallet.storage.WalletStorage
findListByIdentityIds, getWalletPrivateKey, getWalletsCount, hasWallet, hasWalletBackup, listWallets, retrieveWalletBlockchainState
-
Constructor Details
-
CachedAccountStorage
public CachedAccountStorage(org.exoplatform.services.cache.CacheService cacheService, WalletAccountDAO walletAccountDAO, WalletAccountBackupDAO walletAccountBackupDAO, WalletPrivateKeyDAO privateKeyDAO, WalletBlockchainStateDAO blockchainStateDAO, org.exoplatform.web.security.codec.CodecInitializer codecInitializer)
-
-
Method Details
-
getWalletByAddress
- Overrides:
getWalletByAddressin classWalletStorage- Parameters:
address- wallet addresscontractAddress- contract address to use for wallet blockchain state- Returns:
Walletdetails identified by address
-
getWalletByIdentityId
- Overrides:
getWalletByIdentityIdin classWalletStorage- Parameters:
identityId- user/space technical identty idcontractAddress- contract address to use for wallet blockchain state- Returns:
Walletdetails for identity
-
saveWalletBackupState
public io.meeds.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 io.meeds.wallet.model.Wallet saveWallet(io.meeds.wallet.model.Wallet wallet, boolean isNew) throws io.meeds.wallet.model.AddressAlreadyInUseException - Overrides:
saveWalletin classWalletStorage- Parameters:
wallet- wallet details to saveisNew- whether this is a new wallet association or not- Returns:
- saved wallet entity
- Throws:
io.meeds.wallet.model.AddressAlreadyInUseException- when the address is already used by another wallet
-
switchToInternalWallet
public void switchToInternalWallet(long walletId) Description copied from class:WalletStorageSwitchesWalletto internal provider and transaction signer- Overrides:
switchToInternalWalletin classWalletStorage- Parameters:
walletId-Walletunique identifier
-
switchToWalletProvider
public void switchToWalletProvider(long walletId, io.meeds.wallet.model.WalletProvider provider, String newAddress) Description copied from class:WalletStorageSwitchesWalletto a new wallet provider and transaction signer- Overrides:
switchToWalletProviderin classWalletStorage- Parameters:
walletId-Walletunique identifierprovider-WalletProviderthat must be different from Internal WalletnewAddress- Selected address provided from new Wallet Provider Tool
-
saveWalletBlockchainState
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 io.meeds.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
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()
-