public abstract class VaultRequest extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_HEADER_AUTHORIZATION
HTTP header value for the Vault session
Value = "Authorization"
|
static String |
HTTP_HEADER_VAULT_CLIENT_ID |
protected VaultClient |
vaultClient
The Vault client, containing domain, authentication, and session information.
|
Modifier | Constructor and Description |
---|---|
protected |
VaultRequest()
Default constructor for the abstract VaultRequest class.
|
Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.databind.ObjectMapper |
getBaseObjectMapper()
Base object mapper for common mapping rules of Vault requests.
|
protected <T> T |
send(HttpRequestConnector.HttpMethod method,
HttpRequestConnector request,
Class<T> responseObjectClass)
Perform an HTTP request after setting standard Vault information
such as the session id.
|
protected <T> T |
send(HttpRequestConnector.HttpMethod method,
HttpRequestConnector request,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
Class<T> responseObjectClass)
Perform an HTTP request after setting standard Vault information
such as the session id.
|
protected <T> T |
sendReturnBinary(HttpRequestConnector.HttpMethod method,
HttpRequestConnector request,
Class<T> responseObjectClass)
Perform an HTTP request that creates a file.
|
protected <T> T |
sendReturnBinary(HttpRequestConnector.HttpMethod method,
HttpRequestConnector request,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
Class<T> responseObjectClass)
Perform an HTTP request that creates a file.
|
protected <T> T |
sendToFile(HttpRequestConnector.HttpMethod method,
HttpRequestConnector request,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
String outputFilePath,
Class<T> responseObjectClass)
Perform an HTTP request that creates a file.
|
protected <T> T |
sendToFile(HttpRequestConnector.HttpMethod method,
HttpRequestConnector request,
String outputFilePath,
Class<T> responseObjectClass)
Perform an HTTP request that creates a file.
|
void |
setVaultClient(VaultClient vaultClient)
Set the VaultClient for Vault domain and connection information
|
public static final String HTTP_HEADER_AUTHORIZATION
public static final String HTTP_HEADER_VAULT_CLIENT_ID
protected VaultClient vaultClient
protected VaultRequest()
protected <T> T send(HttpRequestConnector.HttpMethod method, HttpRequestConnector request, Class<T> responseObjectClass)
T
- The objectmethod
- HTTP Method (GET, POST, PUT, DELETE)request
- Fully formed HTTP requestresponseObjectClass
- POJO class representing the deserialized JSON responseprotected <T> T send(HttpRequestConnector.HttpMethod method, HttpRequestConnector request, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<T> responseObjectClass)
A passed object mapper allows flexibility for the calling method to set deserialization rules when processing the response. User this method to have greater control of the JSON deserialization. For example, set a deserialization rule to treat a single JSON object as a JSON array.
T
- The objectmethod
- HTTP Method (GET, POST, PUT, DELETE)request
- Fully formed HTTP requestobjectMapper
- Deserialization object mapper to POJOresponseObjectClass
- POJO class representing the deserialized JSON responseprotected <T> T sendToFile(HttpRequestConnector.HttpMethod method, HttpRequestConnector request, String outputFilePath, Class<T> responseObjectClass)
T
- The objectmethod
- HTTP Method (GET, POST, PUT, DELETE)request
- Fully formed HTTP requestoutputFilePath
- file path for the output fileresponseObjectClass
- POJO class representing the deserialized JSON responseprotected <T> T sendToFile(HttpRequestConnector.HttpMethod method, HttpRequestConnector request, com.fasterxml.jackson.databind.ObjectMapper objectMapper, String outputFilePath, Class<T> responseObjectClass)
A passed object mapper allows flexibility for the calling method to set deserialization rules when processing the response. User this method to have greater control of the JSON deserialization. For example, set a deserialization rule to treat a single JSON object as a JSON array.
T
- The objectmethod
- HTTP Method (GET, POST, PUT, DELETE)request
- Fully formed HTTP requestobjectMapper
- Deserialization object mapper to POJOoutputFilePath
- file path for the output fileresponseObjectClass
- POJO class representing the deserialized JSON responseprotected <T> T sendReturnBinary(HttpRequestConnector.HttpMethod method, HttpRequestConnector request, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<T> responseObjectClass)
A passed object mapper allows flexibility for the calling method to set deserialization rules when processing the response. User this method to have greater control of the JSON deserialization. For example, set a deserialization rule to treat a single JSON object as a JSON array.
T
- The objectmethod
- HTTP Method (GET, POST, PUT, DELETE)request
- Fully formed HTTP requestobjectMapper
- Deserialization object mapper to POJOresponseObjectClass
- POJO class representing the deserialized JSON responseprotected <T> T sendReturnBinary(HttpRequestConnector.HttpMethod method, HttpRequestConnector request, Class<T> responseObjectClass)
T
- The objectmethod
- HTTP Method (GET, POST, PUT, DELETE)request
- Fully formed HTTP requestresponseObjectClass
- POJO class representing the deserialized JSON responsepublic com.fasterxml.jackson.databind.ObjectMapper getBaseObjectMapper()
public void setVaultClient(VaultClient vaultClient)
vaultClient
- The VaultClientCopyright © 2021. All rights reserved.