public static interface VaultOperations.VaultSession
VaultOperations.VaultSession
exposes request accessor
methods to be executed in an authenticated context.Modifier and Type | Method and Description |
---|---|
<T,S extends T> |
deleteForEntity(String path,
Class<T> responseType)
Delete a resource by DELETEing from the path, and returns the response as
VaultResponseEntity . |
<T,S extends T> |
exchange(String pathTemplate,
HttpMethod method,
HttpEntity<?> requestEntity,
Class<T> responseType,
Map<String,?> uriVariables)
Execute the HTTP method to the given URI template, writing the given request
entity to the request, and returns the response as
VaultResponseEntity . |
<T,S extends T> |
exchange(String pathTemplate,
HttpMethod method,
HttpEntity<?> requestEntity,
ParameterizedTypeReference<T> responseType,
Map<String,?> uriVariables)
Execute the HTTP method to the given path template, writing the given request
entity to the request, and returns the response as
VaultResponseEntity . |
<T,S extends T> |
getForEntity(String path,
Class<T> responseType)
Retrieve a resource by GETting from the path, and returns the response as
VaultResponseEntity . |
<T,S extends T> |
postForEntity(String path,
Object request,
Class<T> responseType)
Issue a POST request using the given object to the path, and returns the
response as
VaultResponseEntity . |
<T,S extends T> |
putForEntity(String path,
Object request,
Class<T> responseType)
Create a new resource by PUTting the given object to the path, and returns the
response as
VaultResponseEntity . |
<T,S extends T> VaultResponseEntity<S> getForEntity(String path, Class<T> responseType)
VaultResponseEntity
.path
- the path.responseType
- the type of the return valueVaultResponseEntity
<T,S extends T> VaultResponseEntity<S> postForEntity(String path, Object request, Class<T> responseType)
VaultResponseEntity
.path
- the path.request
- the Object to be POSTed, may be null
.responseType
- the type of the return valueVaultResponseEntity
<T,S extends T> VaultResponseEntity<S> putForEntity(String path, Object request, Class<T> responseType)
VaultResponseEntity
.path
- the path.request
- the Object to be PUT.responseType
- the type of the return valueVaultResponseEntity
<T,S extends T> VaultResponseEntity<S> deleteForEntity(String path, Class<T> responseType)
VaultResponseEntity
.path
- the path.responseType
- the type of the return valueVaultResponseEntity
<T,S extends T> VaultResponseEntity<S> exchange(String pathTemplate, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
VaultResponseEntity
.
URI Template variables are using the given URI variables, if any.
pathTemplate
- the path template.method
- the HTTP method (GET, POST, etc).requestEntity
- the entity (headers and/or body) to write to the request,
may be null
.responseType
- the type of the return value.uriVariables
- the variables to expand in the template.<T,S extends T> VaultResponseEntity<S> exchange(String pathTemplate, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Map<String,?> uriVariables)
VaultResponseEntity
.
The given ParameterizedTypeReference
is used to pass generic type
information:
ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() { }; ResponseEntity<List<MyBean>> response = session.exchange("http://example.com", HttpMethod.GET, null, myBean, null);
pathTemplate
- the path template.method
- the HTTP method (GET, POST, etc).requestEntity
- the entity (headers and/or body) to write to the request,
may be null
.responseType
- the type of the return value.uriVariables
- the variables to expand in the template.Copyright © 2016–2017 Pivotal Software, Inc.. All rights reserved.