Class MongoVaultDao
java.lang.Object
dev.getelements.elements.dao.mongo.blockchain.MongoVaultDao
- All Implemented Interfaces:
VaultDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateVault(Vault vault) Creates a newVault.voiddeleteVault(String vaultId) Deletes aVaultwith the supplied identifier.voiddeleteVaultForUser(String vaultId, String userId) Deletes theVaultfor the supplied ursefindAndUpdateVaultBelongingToUser(Vault vault, String userId) Updates a vault with the provided user.findMongoVault(String vaultId) findMongoVaultForUser(String vaultId, String userId) Finds aVault.findVaultForUser(String vaultId, String userId) Finds aVaultwith the supplied id and user id.dev.morphia.DatastoregetMongoVault(String vaultId) Gets all vaults in the system.voidsetDatastore(dev.morphia.Datastore datastore) voidsetMapper(MapperRegistry mapperRegistry) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoUserDao(MongoUserDao mongoUserDao) voidsetMongoWalletDao(MongoWalletDao mongoWalletDao) voidsetValidationHelper(ValidationHelper validationHelper) updateVault(Vault vault) Updates theVault.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.dao.VaultDao
getVault, getVaultForUser
-
Constructor Details
-
MongoVaultDao
public MongoVaultDao()
-
-
Method Details
-
getVaults
Description copied from interface:VaultDaoGets all vaults in the system.- Specified by:
getVaultsin interfaceVaultDao- Parameters:
offset- the offsetcount- the countuserId- the user ID, or null- Returns:
- a
Pagination<Vault>
-
findVault
Description copied from interface:VaultDaoFinds aVault. -
findVaultForUser
Description copied from interface:VaultDaoFinds aVaultwith the supplied id and user id.- Specified by:
findVaultForUserin interfaceVaultDao- Parameters:
vaultId- the vault IDuserId- the user ID- Returns:
- the vault ID
-
getMongoVault
-
findMongoVault
-
findMongoVaultForUser
-
createVault
Description copied from interface:VaultDaoCreates a newVault.- Specified by:
createVaultin interfaceVaultDao- Parameters:
vault- the vault- Returns:
- the
Vaultas was written to the database
-
updateVault
Description copied from interface:VaultDaoUpdates theVault.- Specified by:
updateVaultin interfaceVaultDao- Parameters:
vault- the vault- Returns:
- the
Vaultas was written to the database
-
findAndUpdateVaultBelongingToUser
Description copied from interface:VaultDaoUpdates 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:
findAndUpdateVaultBelongingToUserin interfaceVaultDao- Parameters:
vault- the vault to updateuserId- the user ID to search- Returns:
- an
Optional<Vault>
-
deleteVault
Description copied from interface:VaultDaoDeletes aVaultwith the supplied identifier.- Specified by:
deleteVaultin interfaceVaultDao- Parameters:
vaultId- the Vault ID
-
deleteVaultForUser
Description copied from interface:VaultDaoDeletes theVaultfor the supplied urse- Specified by:
deleteVaultForUserin interfaceVaultDao- Parameters:
vaultId- the vauld IDuserId- the user ID
-
getMapper
-
setMapper
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMongoUserDao
-
setMongoUserDao
-
getMongoDBUtils
-
setMongoDBUtils
-
getMongoWalletDao
-
setMongoWalletDao
-
getValidationHelper
-
setValidationHelper
-