Package dev.getelements.elements.sdk.dao
Interface VaultDao
- All Known Implementing Classes:
MongoVaultDao
public interface VaultDao
Manages instance of the
Vault
.-
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.Finds aVault
.findVaultForUser
(String vaultId, String userId) Finds aVault
with the supplied id and user id.default Vault
Gets aVault
the vault.default Vault
getVaultForUser
(String vaultId, String userId) Gets the the vault ID.Gets all vaults in the system.updateVault
(Vault vault) Updates theVault
.
-
Method Details
-
getVaults
Gets all vaults in the system.- Parameters:
offset
- the offsetcount
- the countuserId
- the user ID, or null- Returns:
- a
Pagination<Vault>
-
findVault
Finds aVault
. -
getVault
Gets aVault
the vault.- Parameters:
vaultId
- the vault ID- Returns:
- the vault, never null
-
findVaultForUser
Finds aVault
with the supplied id and user id.- Parameters:
vaultId
- the vault IDuserId
- the user ID- Returns:
- the vault ID
-
getVaultForUser
Gets the the vault ID.- Parameters:
vaultId
- the vault IDuserId
- the user ID- Returns:
- the vault, never null.
-
createVault
Creates a newVault
.- Parameters:
vault
- the vault- Returns:
- the
Vault
as was written to the database
-
updateVault
Updates theVault
.- Parameters:
vault
- the vault- Returns:
- the
Vault
as was written to the database
-
findAndUpdateVaultBelongingToUser
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.
-
deleteVault
Deletes aVault
with the supplied identifier.- Parameters:
vaultId
- the Vault ID
-
deleteVaultForUser
Deletes theVault
for the supplied urse- Parameters:
vaultId
- the vauld IDuserId
- the user ID
-