Class MongoWalletDao

java.lang.Object
dev.getelements.elements.dao.mongo.blockchain.MongoWalletDao
All Implemented Interfaces:
WalletDao

public class MongoWalletDao extends Object implements WalletDao
  • 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 all Wallet instances, specifying a search query.
      Specified by:
      getWallets in interface WalletDao
      Parameters:
      offset - the offset
      count - the count
      vaultId -
      userId - the userId, or null
      protocol - the protocol, or null
      networks - the network, or null
      Returns:
      a Pagination of Wallet instances
    • findWallet

      public Optional<Wallet> findWallet(String walletId)
      Description copied from interface: WalletDao
      Finds a Wallet based on wallet id.
      Specified by:
      findWallet in interface WalletDao
      Parameters:
      walletId - the wallet id
      Returns:
      the Optional<Wallet>
    • findMongoWallet

      public Optional<MongoWallet> findMongoWallet(String walletId)
    • findWalletInVault

      public Optional<Wallet> findWalletInVault(String walletId, String vaultId)
      Description copied from interface: WalletDao
      Finds a wallet in the specified vault.
      Specified by:
      findWalletInVault in interface WalletDao
      Parameters:
      walletId - the wallet id
      vaultId - the vault id
      Returns:
      the Optional<Wallet>
    • findMongoWalletInVault

      public Optional<MongoWallet> findMongoWalletInVault(String walletId, String vaultId)
    • findWalletForUser

      public Optional<Wallet> findWalletForUser(String walletId, String userId)
      Description copied from interface: WalletDao
      Finds a wallet belonging to the specified user..
      Specified by:
      findWalletForUser in interface WalletDao
      Parameters:
      walletId - the wallet id
      userId - the user id
      Returns:
      the Optional<Wallet>
    • findMongoWalletForUser

      public Optional<MongoWallet> findMongoWalletForUser(String walletId, String userId)
    • 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 interface WalletDao
      Parameters:
      vaultId - the vault id
      blockchainNetwork - the network
      Returns:
      the wallet
    • updateWallet

      public Wallet updateWallet(Wallet wallet)
      Description copied from interface: WalletDao
      Updates the supplied Wallet.
      Specified by:
      updateWallet in interface WalletDao
      Parameters:
      wallet -
      Returns:
      the Wallet as it was changed by the service.
    • createWallet

      public Wallet createWallet(Wallet wallet)
      Description copied from interface: WalletDao
      Creates a new Wallet.
      Specified by:
      createWallet in interface WalletDao
      Parameters:
      wallet - the Wallet with the information to create
      Returns:
      the Wallet as it was created by the service.
    • deleteWallet

      public void deleteWallet(String walletId)
      Description copied from interface: WalletDao
      Deletes the Wallet with the supplied wallet ID.
      Specified by:
      deleteWallet in interface WalletDao
      Parameters:
      walletId - the template ID.
    • deleteWalletForUser

      public void deleteWalletForUser(String walletId, String userId)
      Description copied from interface: WalletDao
      Deletes a wallet for the supplied user.
      Specified by:
      deleteWalletForUser in interface WalletDao
      Parameters:
      walletId - the wallet id
      userId - the user id
    • deleteWalletForVault

      public void deleteWalletForVault(String walletId, String vaultId)
      Description copied from interface: WalletDao
      Deletes a wallet for the supplied user and vault.
      Specified by:
      deleteWalletForVault in interface WalletDao
      Parameters:
      walletId - the wallet ID
      vaultId - the vault ID
    • deleteWalletsInMongoVault

      public long deleteWalletsInMongoVault(MongoVault vault)
    • getMapper

      public MapperRegistry getMapper()
    • setMapper

      @Inject public void setMapper(MapperRegistry mapperRegistry)
    • getDatastore

      public dev.morphia.Datastore getDatastore()
    • setDatastore

      @Inject public void setDatastore(dev.morphia.Datastore datastore)
    • getMongoUserDao

      public MongoUserDao getMongoUserDao()
    • setMongoUserDao

      @Inject public void setMongoUserDao(MongoUserDao mongoUserDao)
    • getMongoVaultDao

      public MongoVaultDao getMongoVaultDao()
    • setMongoVaultDao

      @Inject public void setMongoVaultDao(MongoVaultDao mongoVaultDao)
    • getMongoDBUtils

      public MongoDBUtils getMongoDBUtils()
    • setMongoDBUtils

      @Inject public void setMongoDBUtils(MongoDBUtils mongoDBUtils)
    • getValidationHelper

      public ValidationHelper getValidationHelper()
    • setValidationHelper

      @Inject public void setValidationHelper(ValidationHelper validationHelper)