All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bettercloud.vault.response.LogicalResponse Maven / Gradle / Ivy

There is a newer version: 5.1.0
Show newest version
package com.bettercloud.vault.response;

import com.bettercloud.vault.rest.RestResponse;

import java.util.HashMap;
import java.util.Map;

/**
 * This class is a container for the information returned by Vault in logical API
 * operations (e.g. read, write).
 */
public class LogicalResponse extends VaultResponse {

    private Map data = new HashMap();

    /**
     * This constructor simply exposes the common base class constructor.
     *
     * @param restResponse The raw HTTP response from Vault.
     * @param retries The number of retry attempts that occurred during the API call (can be zero).
     */
    public LogicalResponse(final RestResponse restResponse, final int retries) {
        super(restResponse, retries);
    }

    /**
     * This constructor also takes all of the values read by a Vault read operation.
     *
     * @param restResponse The raw HTTP response from Vault.
     * @param retries The number of retry attempts that occurred during the API call (can be zero).
     * @param data All name/value pairs found in the data section of a Vault read operation response.
     */
    public LogicalResponse(
            final RestResponse restResponse,
            final int retries,
            final Map data
    ) {
        super(restResponse, retries);
        this.data.putAll(data);
    }

    public Map getData() {
        return data;
    }

    public void setData(final Map data) {
        this.data = data;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy