Class KvV2

java.lang.Object
codes.grow.packages.vault.KvV2
All Implemented Interfaces:
Kv

public final class KvV2 extends Object implements Kv
KV version 2 (versioned) mount.
  • Method Details

    • mount

      public String mount()
      Description copied from interface: Kv
      Returns the mount path.
      Specified by:
      mount in interface Kv
      Returns:
      the mount, without slashes
    • version

      public int version()
      Returns the KV version.
      Returns:
      always 2
    • readAsync

      public CompletableFuture<KvSecret> readAsync(String path, Integer version)
      Description copied from interface: Kv
      Asynchronous read.
      Specified by:
      readAsync in interface Kv
      Parameters:
      path - secret path
      version - version, or null for the latest
      Returns:
      a future with the secret
    • writeAsync

      public CompletableFuture<Optional<KvVersionMetadata>> writeAsync(String path, Map<String,?> data, Integer cas)
      Description copied from interface: Kv
      Asynchronous write.
      Specified by:
      writeAsync in interface Kv
      Parameters:
      path - secret path
      data - data map
      cas - expected current version, or null
      Returns:
      a future with the new version metadata
    • patchAsync

      public CompletableFuture<KvVersionMetadata> patchAsync(String path, Map<String,?> data, Integer cas)
      Description copied from interface: Kv
      Asynchronous patch.
      Specified by:
      patchAsync in interface Kv
      Parameters:
      path - secret path
      data - fields to merge
      cas - expected current version, or null
      Returns:
      a future with the new version metadata
    • deleteAsync

      public CompletableFuture<Void> deleteAsync(String path)
      Description copied from interface: Kv
      Asynchronous delete.
      Specified by:
      deleteAsync in interface Kv
      Parameters:
      path - secret path
      Returns:
      a future completed when done
    • deleteVersionsAsync

      public CompletableFuture<Void> deleteVersionsAsync(String path, List<Integer> versions)
      Description copied from interface: Kv
      Asynchronous deleteVersions.
      Specified by:
      deleteVersionsAsync in interface Kv
      Parameters:
      path - secret path
      versions - versions
      Returns:
      a future completed when done
    • undeleteAsync

      public CompletableFuture<Void> undeleteAsync(String path, List<Integer> versions)
      Description copied from interface: Kv
      Asynchronous undelete.
      Specified by:
      undeleteAsync in interface Kv
      Parameters:
      path - secret path
      versions - versions
      Returns:
      a future completed when done
    • destroyAsync

      public CompletableFuture<Void> destroyAsync(String path, List<Integer> versions)
      Description copied from interface: Kv
      Asynchronous destroy.
      Specified by:
      destroyAsync in interface Kv
      Parameters:
      path - secret path
      versions - versions
      Returns:
      a future completed when done
    • listAsync

      public CompletableFuture<List<String>> listAsync(String path)
      Description copied from interface: Kv
      Asynchronous list. Vault OSS lists have no pagination: every key is returned at once.
      Specified by:
      listAsync in interface Kv
      Parameters:
      path - folder path
      Returns:
      a future with the keys
    • readMetadataAsync

      public CompletableFuture<KvMetadata> readMetadataAsync(String path)
      Description copied from interface: Kv
      Asynchronous readMetadata.
      Specified by:
      readMetadataAsync in interface Kv
      Parameters:
      path - secret path
      Returns:
      a future with the metadata
    • writeMetadataAsync

      public CompletableFuture<Void> writeMetadataAsync(String path, KvMetadataOptions o)
      Description copied from interface: Kv
      Asynchronous writeMetadata.
      Specified by:
      writeMetadataAsync in interface Kv
      Parameters:
      path - secret path
      o - settings
      Returns:
      a future completed when done
    • deleteMetadataAsync

      public CompletableFuture<Void> deleteMetadataAsync(String path)
      Description copied from interface: Kv
      Asynchronous deleteMetadata.
      Specified by:
      deleteMetadataAsync in interface Kv
      Parameters:
      path - secret path
      Returns:
      a future completed when done
    • toString

      public String toString()
      Overrides:
      toString in class Object