Package org.springframework.vault.core
Class VaultVersionedKeyValueTemplate
java.lang.Object
org.springframework.vault.core.VaultVersionedKeyValueTemplate
- All Implemented Interfaces:
VaultKeyValueOperationsSupport,VaultVersionedKeyValueOperations
public class VaultVersionedKeyValueTemplate
extends Object
implements VaultVersionedKeyValueOperations
Default implementation of
VaultVersionedKeyValueOperations.- Since:
- 2.1
- Author:
- Mark Paluch, Maciej Drozdzowski
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.vault.core.VaultKeyValueOperationsSupport
VaultKeyValueOperationsSupport.KeyValueBackend -
Constructor Summary
ConstructorsConstructorDescriptionVaultVersionedKeyValueTemplate(VaultOperations vaultOperations, String path) -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete the secret atpath.voiddelete(String path, Versioned.Version... versionsToDelete) Delete one or moreversionsof the secret atpath.voiddestroy(String path, Versioned.Version... versionsToDelete) Permanently remove the specifiedversionsof the secret atpath.get(String path, Versioned.Version version) Read the requestedVersioned.Versionof the secret atpath.<T> Versioned<T>get(String path, Versioned.Version version, Class<T> responseType) Read the requestedVersioned.Versionof the secret atpathand deserialize the secret to the givenresponseType.Enumerate keys from a Vault path.Write theversioned secretatpath.voidundelete(String path, Versioned.Version... versionsToDelete) Undelete (restore) one or moreversionsof the secret atpath.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.vault.core.VaultKeyValueOperationsSupport
delete, getApiVersion, listMethods inherited from interface org.springframework.vault.core.VaultVersionedKeyValueOperations
get, get
-
Constructor Details
-
VaultVersionedKeyValueTemplate
- Parameters:
vaultOperations- must not be null.path- must not be empty or null.
-
-
Method Details
-
get
Description copied from interface:VaultVersionedKeyValueOperationsRead the requestedVersioned.Versionof the secret atpath.- Specified by:
getin interfaceVaultVersionedKeyValueOperations- Parameters:
path- must not be null.version- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
get
@Nullable public <T> Versioned<T> get(String path, Versioned.Version version, Class<T> responseType) Description copied from interface:VaultVersionedKeyValueOperationsRead the requestedVersioned.Versionof the secret atpathand deserialize the secret to the givenresponseType.- Specified by:
getin interfaceVaultVersionedKeyValueOperations- Parameters:
path- must not be null.version- must not be null.responseType- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
put
Description copied from interface:VaultVersionedKeyValueOperationsWrite theversioned secretatpath.bodymay be either plain secrets (e.g. map) orVersionedobjects. UsingVersionedwill apply versioning for Compare-and-Set (CAS).- Specified by:
putin interfaceVaultVersionedKeyValueOperations- Parameters:
path- must not be null.body- must not be null.- Returns:
- the resulting
Versioned.Metadata.
-
delete
Description copied from interface:VaultVersionedKeyValueOperationsDelete one or moreversionsof the secret atpath.- Specified by:
deletein interfaceVaultVersionedKeyValueOperations- Parameters:
path- must not be null.versionsToDelete- must not be null or empty.
-
undelete
Description copied from interface:VaultVersionedKeyValueOperationsUndelete (restore) one or moreversionsof the secret atpath.- Specified by:
undeletein interfaceVaultVersionedKeyValueOperations- Parameters:
path- must not be null.versionsToDelete- must not be null or empty.
-
destroy
Description copied from interface:VaultVersionedKeyValueOperationsPermanently remove the specifiedversionsof the secret atpath.- Specified by:
destroyin interfaceVaultVersionedKeyValueOperations- Parameters:
path- must not be null.versionsToDelete- must not be null or empty.
-
opsForKeyValueMetadata
Description copied from interface:VaultVersionedKeyValueOperations- Specified by:
opsForKeyValueMetadatain interfaceVaultVersionedKeyValueOperations- Returns:
- the operations interface to interact with the Vault Key/Value metadata backend
-
list
Description copied from interface:VaultKeyValueOperationsSupportEnumerate keys from a Vault path.- Parameters:
path- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
getApiVersion
- Returns:
- the used API version.
-
delete
Description copied from interface:VaultKeyValueOperationsSupportDelete the secret atpath.- Specified by:
deletein interfaceVaultKeyValueOperationsSupport- Parameters:
path- must not be null.
-