Class MongoWalletDao
java.lang.Object
dev.getelements.elements.dao.mongo.blockchain.MongoWalletDao
- All Implemented Interfaces:
WalletDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWallet
(Wallet wallet) Creates a new Wallet.void
deleteWallet
(String walletId) Deletes theWallet
with the supplied wallet ID.void
deleteWalletForUser
(String walletId, String userId) Deletes a wallet for the supplied user.void
deleteWalletForVault
(String walletId, String vaultId) Deletes a wallet for the supplied user and vault.long
findMongoWallet
(String walletId) findMongoWalletForUser
(String walletId, String userId) findMongoWalletInVault
(String walletId, String vaultId) findWallet
(String walletId) Finds aWallet
based on wallet id.findWalletForUser
(String walletId, String userId) Finds a wallet belonging to the specified user..findWalletInVault
(String walletId, String vaultId) Finds a wallet in the specified vault.dev.morphia.Datastore
getSingleWalletFromVaultForNetwork
(String vaultId, BlockchainNetwork blockchainNetwork) Attempts to find a single wallet for the supplied vault ID and blockchain network.getWallets
(int offset, int count, String vaultId, String userId, BlockchainApi protocol, List<BlockchainNetwork> networks) Lists allWallet
instances, specifying a search query.void
setDatastore
(dev.morphia.Datastore datastore) void
setMapper
(MapperRegistry mapperRegistry) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoUserDao
(MongoUserDao mongoUserDao) void
setMongoVaultDao
(MongoVaultDao mongoVaultDao) void
setValidationHelper
(ValidationHelper validationHelper) updateWallet
(Wallet wallet) Updates the suppliedWallet
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.dao.WalletDao
getWallet, getWalletForUser, getWalletInVault
-
Constructor Details
-
MongoWalletDao
public MongoWalletDao()
-
-
Method Details
-
getWallets
public Pagination<Wallet> getWallets(int offset, int count, String vaultId, String userId, BlockchainApi protocol, List<BlockchainNetwork> networks) Description copied from interface:WalletDao
Lists allWallet
instances, specifying a search query.- Specified by:
getWallets
in interfaceWalletDao
- Parameters:
offset
- the offsetcount
- the countvaultId
-userId
- the userId, or nullprotocol
- the protocol, or nullnetworks
- the network, or null- Returns:
- a
Pagination
ofWallet
instances
-
findWallet
Description copied from interface:WalletDao
Finds aWallet
based on wallet id.- Specified by:
findWallet
in interfaceWalletDao
- Parameters:
walletId
- the wallet id- Returns:
- the
Optional<Wallet>
-
findMongoWallet
-
findWalletInVault
Description copied from interface:WalletDao
Finds a wallet in the specified vault.- Specified by:
findWalletInVault
in interfaceWalletDao
- Parameters:
walletId
- the wallet idvaultId
- the vault id- Returns:
- the
Optional<Wallet>
-
findMongoWalletInVault
-
findWalletForUser
Description copied from interface:WalletDao
Finds a wallet belonging to the specified user..- Specified by:
findWalletForUser
in interfaceWalletDao
- Parameters:
walletId
- the wallet iduserId
- the user id- Returns:
- the
Optional<Wallet>
-
findMongoWalletForUser
-
getSingleWalletFromVaultForNetwork
public Wallet getSingleWalletFromVaultForNetwork(String vaultId, BlockchainNetwork blockchainNetwork) Description copied from interface:WalletDao
Attempts to find a single wallet for the supplied vault ID and blockchain network.- Specified by:
getSingleWalletFromVaultForNetwork
in interfaceWalletDao
- Parameters:
vaultId
- the vault idblockchainNetwork
- the network- Returns:
- the wallet
-
updateWallet
Description copied from interface:WalletDao
Updates the suppliedWallet
.- Specified by:
updateWallet
in interfaceWalletDao
- Parameters:
wallet
-- Returns:
- the
Wallet
as it was changed by the service.
-
createWallet
Description copied from interface:WalletDao
Creates a new Wallet.- Specified by:
createWallet
in interfaceWalletDao
- Parameters:
wallet
- theWallet
with the information to create- Returns:
- the
Wallet
as it was created by the service.
-
deleteWallet
Description copied from interface:WalletDao
Deletes theWallet
with the supplied wallet ID.- Specified by:
deleteWallet
in interfaceWalletDao
- Parameters:
walletId
- the template ID.
-
deleteWalletForUser
Description copied from interface:WalletDao
Deletes a wallet for the supplied user.- Specified by:
deleteWalletForUser
in interfaceWalletDao
- Parameters:
walletId
- the wallet iduserId
- the user id
-
deleteWalletForVault
Description copied from interface:WalletDao
Deletes a wallet for the supplied user and vault.- Specified by:
deleteWalletForVault
in interfaceWalletDao
- Parameters:
walletId
- the wallet IDvaultId
- the vault ID
-
deleteWalletsInMongoVault
-
getMapper
-
setMapper
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMongoUserDao
-
setMongoUserDao
-
getMongoVaultDao
-
setMongoVaultDao
-
getMongoDBUtils
-
setMongoDBUtils
-
getValidationHelper
-
setValidationHelper
-