Class MongoVaultDao

java.lang.Object
dev.getelements.elements.dao.mongo.blockchain.MongoVaultDao
All Implemented Interfaces:
VaultDao

public class MongoVaultDao extends Object implements VaultDao
  • Constructor Details

    • MongoVaultDao

      public MongoVaultDao()
  • Method Details

    • getVaults

      public Pagination<Vault> getVaults(int offset, int count, String userId)
      Description copied from interface: VaultDao
      Gets all vaults in the system.
      Specified by:
      getVaults in interface VaultDao
      Parameters:
      offset - the offset
      count - the count
      userId - the user ID, or null
      Returns:
      a Pagination<Vault>
    • findVault

      public Optional<Vault> findVault(String vaultId)
      Description copied from interface: VaultDao
      Finds a Vault.
      Specified by:
      findVault in interface VaultDao
      Parameters:
      vaultId - the Vault id
      Returns:
      an Optional Vault
    • findVaultForUser

      public Optional<Vault> findVaultForUser(String vaultId, String userId)
      Description copied from interface: VaultDao
      Finds a Vault with the supplied id and user id.
      Specified by:
      findVaultForUser in interface VaultDao
      Parameters:
      vaultId - the vault ID
      userId - the user ID
      Returns:
      the vault ID
    • getMongoVault

      public MongoVault getMongoVault(String vaultId)
    • findMongoVault

      public Optional<MongoVault> findMongoVault(String vaultId)
    • findMongoVaultForUser

      public Optional<MongoVault> findMongoVaultForUser(String vaultId, String userId)
    • createVault

      public Vault createVault(Vault vault)
      Description copied from interface: VaultDao
      Creates a new Vault.
      Specified by:
      createVault in interface VaultDao
      Parameters:
      vault - the vault
      Returns:
      the Vault as was written to the database
    • updateVault

      public Vault updateVault(Vault vault)
      Description copied from interface: VaultDao
      Updates the Vault.
      Specified by:
      updateVault in interface VaultDao
      Parameters:
      vault - the vault
      Returns:
      the Vault as was written to the database
    • findAndUpdateVaultBelongingToUser

      public Optional<Vault> findAndUpdateVaultBelongingToUser(Vault vault, String userId)
      Description copied from interface: VaultDao
      Updates a vault with the provided user. If the requested vault exists for the supplied user, then the specifed vault will be updated.

      If no vault exists for the supplied user, then no changes will be made to the database and the returned Optional will be empty.

      Specified by:
      findAndUpdateVaultBelongingToUser in interface VaultDao
      Parameters:
      vault - the vault to update
      userId - the user ID to search
      Returns:
      an Optional<Vault>
    • deleteVault

      public void deleteVault(String vaultId)
      Description copied from interface: VaultDao
      Deletes a Vault with the supplied identifier.
      Specified by:
      deleteVault in interface VaultDao
      Parameters:
      vaultId - the Vault ID
    • deleteVaultForUser

      public void deleteVaultForUser(String vaultId, String userId)
      Description copied from interface: VaultDao
      Deletes the Vault for the supplied urse
      Specified by:
      deleteVaultForUser in interface VaultDao
      Parameters:
      vaultId - the vauld ID
      userId - the user ID
    • 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)
    • getMongoDBUtils

      public MongoDBUtils getMongoDBUtils()
    • setMongoDBUtils

      @Inject public void setMongoDBUtils(MongoDBUtils mongoDBUtils)
    • getMongoWalletDao

      public MongoWalletDao getMongoWalletDao()
    • setMongoWalletDao

      @Inject public void setMongoWalletDao(MongoWalletDao mongoWalletDao)
    • getValidationHelper

      public ValidationHelper getValidationHelper()
    • setValidationHelper

      @Inject public void setValidationHelper(ValidationHelper validationHelper)