Class HealthResponse

  • All Implemented Interfaces:
    java.io.Serializable

    public class HealthResponse
    extends java.lang.Object
    implements java.io.Serializable
    This class is a container for the information returned by Vault in v1/sys/health operations.
    See Also:
    Serialized Form
    • Constructor Detail

      • HealthResponse

        public HealthResponse​(RestResponse restResponse,
                              int retries)
                       throws VaultException

        Constructs a HealthResponse object from the data received in a health check operation.

        Note that if the REST response is valid, but has an empty payload, this constructor will silently return an instance with initialized, sealed, standby, and serverTimeUTC set to null. This typically happens when you use optional parameters in the health call, to designate non-standard HTTP status codes. See docs for Debug.health(Boolean, Integer, Integer, Integer).

        Parameters:
        restResponse - The raw HTTP response from Vault
        retries - The number of retry attempts that occurred during the API call (can be zero)
        Throws:
        VaultException - If any error occurs or unexpected response is received from Vault
    • Method Detail

      • getRetries

        public int getRetries()
      • getInitialized

        public java.lang.Boolean getInitialized()
      • getSealed

        public java.lang.Boolean getSealed()
      • getStandby

        public java.lang.Boolean getStandby()
      • getServerTimeUTC

        public java.lang.Long getServerTimeUTC()
        Returns:
        A value representing the number of milliseconds since the epoch. With all of the changes in date API's between Java 8 and pre-Java 8, it seemed best for the library not to convert this value into any particular one.