abstract class DefaultRestClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
baseUrl |
private static java.lang.String |
CANT_SERIALIZE_INTO_JSON |
private static java.lang.String |
ERROR_GETTING_CONTENT |
private static java.lang.String |
ERROR_HTTP_STATUS |
private static java.lang.String |
ERROR_PARSING_JSON |
private static java.lang.String |
EXCEPTION_EXECUTING_REQUEST |
private static ObjectMapper |
objectMapper |
private static java.lang.String |
RESPONSE_CODE_IS_NOT |
private int |
timeout |
private static java.lang.String |
WAS |
Constructor and Description |
---|
DefaultRestClient(java.lang.String baseUrl,
int timeout) |
Modifier and Type | Method and Description |
---|---|
private Response |
execute(Request request,
java.lang.String json) |
private HttpResponse |
getHttpResponse(int status,
Response response) |
private <Type> java.lang.String |
getJsonRequest(Type content) |
private java.io.InputStream |
getJsonResult(HttpResponse httpResponse) |
private <Type> Type |
getValue(java.io.InputStream jsonResult,
java.lang.Class<Type> type) |
(package private) <ResponseType> |
request(java.util.function.Function<java.lang.String,Request> method,
java.lang.String url,
java.lang.Class<ResponseType> type,
int status) |
(package private) <RequestType,ResponseType> |
request(java.util.function.Function<java.lang.String,Request> method,
java.lang.String url,
RequestType content,
java.lang.Class<ResponseType> type,
int status) |
private static final java.lang.String CANT_SERIALIZE_INTO_JSON
private static final java.lang.String EXCEPTION_EXECUTING_REQUEST
private static final java.lang.String ERROR_HTTP_STATUS
private static final java.lang.String ERROR_GETTING_CONTENT
private static final java.lang.String ERROR_PARSING_JSON
private static final java.lang.String RESPONSE_CODE_IS_NOT
private static final java.lang.String WAS
private final java.lang.String baseUrl
private static final ObjectMapper objectMapper
private final int timeout
<RequestType,ResponseType> ResponseType request(java.util.function.Function<java.lang.String,Request> method, java.lang.String url, RequestType content, java.lang.Class<ResponseType> type, int status) throws BridgeException
BridgeException
<ResponseType> ResponseType request(java.util.function.Function<java.lang.String,Request> method, java.lang.String url, java.lang.Class<ResponseType> type, int status) throws BridgeException
BridgeException
private Response execute(Request request, java.lang.String json) throws BridgeHttpException
BridgeHttpException
private <Type> Type getValue(java.io.InputStream jsonResult, java.lang.Class<Type> type) throws BridgeJsonException
BridgeJsonException
private <Type> java.lang.String getJsonRequest(Type content) throws BridgeJsonException
BridgeJsonException
private java.io.InputStream getJsonResult(HttpResponse httpResponse) throws BridgeHttpException
BridgeHttpException
private HttpResponse getHttpResponse(int status, Response response) throws BridgeHttpException
BridgeHttpException