java.lang.Object
de.stklcode.jvault.connector.model.response.VaultDataResponse
de.stklcode.jvault.connector.model.response.SecretResponse
All Implemented Interfaces:
VaultResponse, Serializable
Direct Known Subclasses:
MetaSecretResponse, PlainSecretResponse

public abstract class SecretResponse extends VaultDataResponse
Vault response for secret request.
Since:
0.1, 1.1 abstract
Author:
Stefan Kalscheuer
See Also:
  • Constructor Details

    • SecretResponse

      public SecretResponse()
  • Method Details

    • getData

      public abstract Map<String,Serializable> getData()
      Get complete data object.
      Returns:
      data map
      Since:
      0.4.0, 1.1 Serializable map value.
    • getMetadata

      public abstract VersionMetadata getMetadata()
      Get secret metadata. This is only available for KV v2 secrets.
      Returns:
      Metadata of the secret.
      Since:
      0.8
    • get

      public final Object get(String key)
      Get a single value for given key.
      Parameters:
      key - the key
      Returns:
      the value or null if absent
      Since:
      0.4.0
    • get

      public final <C> C get(String key, Class<C> type) throws InvalidResponseException
      Get response parsed as JSON.
      Type Parameters:
      C - Class to parse response
      Parameters:
      key - the key
      type - Class to parse response
      Returns:
      Parsed object or null if absent
      Throws:
      InvalidResponseException - on parsing error
      Since:
      0.4.0