Package org.springframework.vault.client
Class VaultResponses
java.lang.Object
org.springframework.vault.client.VaultResponses
Utility methods to unwrap Vault responses and build
VaultException.- Author:
- Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VaultExceptionbuildException(HttpStatusCode statusCode, String path, String message) static VaultExceptionBuild aVaultExceptiongivenHttpStatusCodeException.static VaultExceptionbuildException(HttpStatusCodeException e, String path) static StringObtain the error message from a JSON response.static <T> ParameterizedTypeReference<VaultResponseSupport<T>>getTypeReference(Class<T> responseType) Create aParameterizedTypeReferenceforresponseType.static <T> TUnwrap a wrapped response created by Vault Response Wrapping
-
Constructor Details
-
VaultResponses
public VaultResponses()
-
-
Method Details
-
buildException
Build aVaultExceptiongivenHttpStatusCodeException.- Parameters:
e- must not be null.- Returns:
- the
VaultException.
-
buildException
- Parameters:
e- must not be null.path- must not be null.- Returns:
- the
VaultException.
-
buildException
-
getTypeReference
public static <T> ParameterizedTypeReference<VaultResponseSupport<T>> getTypeReference(Class<T> responseType) Create aParameterizedTypeReferenceforresponseType.- Parameters:
responseType- must not be null.- Returns:
- the
ParameterizedTypeReferenceforresponseType.
-
getError
Obtain the error message from a JSON response.- Parameters:
json- must not be null.- Returns:
- extracted error string.
-
unwrap
Unwrap a wrapped response created by Vault Response Wrapping- Parameters:
wrappedResponse- the wrapped response , must not be empty or null.responseType- the type of the return value.- Returns:
- the unwrapped response.
-