T - public class StdResponseHandler<T> extends Object implements ResponseCallback<T>
| Constructor and Description |
|---|
StdResponseHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected static <T> T |
checkResponseBodyOkAndReturnDefaultValue(HttpResponse hr,
T defaultValue,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
static DbAccessException |
createDbAccessException(HttpResponse hr)
Creates an DbAccessException which specific type is determined by the response code in the http response.
|
T |
error(HttpResponse hr) |
protected static com.fasterxml.jackson.databind.JsonNode |
responseBodyAsNode(InputStream inputStream,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
T |
success(HttpResponse hr)
Called when http response code is < 300
|
public static DbAccessException createDbAccessException(HttpResponse hr)
hr - protected static com.fasterxml.jackson.databind.JsonNode responseBodyAsNode(InputStream inputStream, com.fasterxml.jackson.databind.ObjectMapper mapper) throws IOException
IOExceptionprotected static <T> T checkResponseBodyOkAndReturnDefaultValue(HttpResponse hr, T defaultValue, com.fasterxml.jackson.databind.ObjectMapper mapper) throws IOException
IOExceptionpublic T error(HttpResponse hr)
error in interface ResponseCallback<T>public T success(HttpResponse hr) throws Exception
ResponseCallbacksuccess in interface ResponseCallback<T>ExceptionCopyright © 2017. All rights reserved.