Package org.chenile.proxy.interceptors
Class HttpInvoker
java.lang.Object
org.chenile.proxy.interceptors.HttpInvoker
- All Implemented Interfaces:
Command<ChenileExchange>
Invokes the remote service using HTTP
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
private ObjectMapper
(package private) org.springframework.boot.web.client.RestTemplateBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static String
constructUrl
(String contextPath, String url, ChenileExchange exchange) Constructs the URL taking care of path variablesvoid
execute
(ChenileExchange exchange) private HttpHeaders
extractHeaders
(ChenileExchange exchange) protected RestTemplate
getRestTemplate
(ChenileExchange chenileExchange) private HttpMethod
private void
populateResponse
(ResponseEntity<GenericResponse<?>> httpResponse, String baseURI, String serviceOpName, ChenileExchange exchange) private void
setCorrectException
(ChenileExchange exchange, Object[] eArgs, RestClientException e)
-
Field Details
-
contextPath
-
restTemplateBuilder
-
objectMapper
-
-
Constructor Details
-
HttpInvoker
public HttpInvoker()
-
-
Method Details
-
execute
- Specified by:
execute
in interfaceCommand<ChenileExchange>
- Throws:
Exception
-
populateResponse
private void populateResponse(ResponseEntity<GenericResponse<?>> httpResponse, String baseURI, String serviceOpName, ChenileExchange exchange) -
setCorrectException
-
constructUrl
Constructs the URL taking care of path variables- Parameters:
url
- - the url inclusive of path variableexchange
- - the chenile exchange- Returns:
- the new URL with paths substituted if required
-
extractHeaders
-
httpMethod
-
getRestTemplate
-