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.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.Finds aVault.findVaultForUser(String vaultId, String userId) Finds aVaultwith the supplied id and user id.default VaultGets aVaultthe vault.default VaultgetVaultForUser(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 aVaultthe vault.- Parameters:
vaultId- the vault ID- Returns:
- the vault, never null
-
findVaultForUser
Finds aVaultwith 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
Vaultas was written to the database
-
updateVault
Updates theVault.- Parameters:
vault- the vault- Returns:
- the
Vaultas 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 aVaultwith the supplied identifier.- Parameters:
vaultId- the Vault ID
-
deleteVaultForUser
Deletes theVaultfor the supplied urse- Parameters:
vaultId- the vauld IDuserId- the user ID
-