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
.void
deleteVault
(String vaultId) Deletes aVault
with the supplied identifier.void
deleteVaultForUser
(String vaultId, String userId) Deletes theVault
for 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 aVault
with the supplied id and user id.dev.morphia.Datastore
getMongoVault
(String vaultId) Gets all vaults in the system.void
setDatastore
(dev.morphia.Datastore datastore) void
setMapper
(MapperRegistry mapperRegistry) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoUserDao
(MongoUserDao mongoUserDao) void
setMongoWalletDao
(MongoWalletDao mongoWalletDao) void
setValidationHelper
(ValidationHelper validationHelper) updateVault
(Vault vault) Updates theVault
.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.VaultDao
getVault, getVaultForUser
-
Constructor Details
-
MongoVaultDao
public MongoVaultDao()
-
-
Method Details
-
getVaults
Description copied from interface:VaultDao
Gets all vaults in the system.- Specified by:
getVaults
in interfaceVaultDao
- Parameters:
offset
- the offsetcount
- the countuserId
- the user ID, or null- Returns:
- a
Pagination<Vault>
-
findVault
Description copied from interface:VaultDao
Finds aVault
. -
findVaultForUser
Description copied from interface:VaultDao
Finds aVault
with the supplied id and user id.- Specified by:
findVaultForUser
in interfaceVaultDao
- Parameters:
vaultId
- the vault IDuserId
- the user ID- Returns:
- the vault ID
-
getMongoVault
-
findMongoVault
-
findMongoVaultForUser
-
createVault
Description copied from interface:VaultDao
Creates a newVault
.- Specified by:
createVault
in interfaceVaultDao
- Parameters:
vault
- the vault- Returns:
- the
Vault
as was written to the database
-
updateVault
Description copied from interface:VaultDao
Updates theVault
.- Specified by:
updateVault
in interfaceVaultDao
- Parameters:
vault
- the vault- Returns:
- the
Vault
as was written to the database
-
findAndUpdateVaultBelongingToUser
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 interfaceVaultDao
- Parameters:
vault
- the vault to updateuserId
- the user ID to search- Returns:
- an
Optional<Vault>
-
deleteVault
Description copied from interface:VaultDao
Deletes aVault
with the supplied identifier.- Specified by:
deleteVault
in interfaceVaultDao
- Parameters:
vaultId
- the Vault ID
-
deleteVaultForUser
Description copied from interface:VaultDao
Deletes theVault
for the supplied urse- Specified by:
deleteVaultForUser
in 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
-