public class MicroserviceRestTemplate
extends org.springframework.web.client.RestTemplate
Constructor and Description |
---|
MicroserviceRestTemplate(Boolean tryToReconnect,
int tryToReconnectTimes,
int sleepTimeBetweenTrying,
String microserviceName,
String pathToApiResource)
RestTemplate that tried to reconnect or error |
MicroserviceRestTemplate(String microserviceName,
String pathToApiResource) |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
doExecute(URI urlFake,
org.springframework.http.HttpMethod method,
org.springframework.web.client.RequestCallback requestCallback,
org.springframework.web.client.ResponseExtractor<T> responseExtractor) |
org.springframework.http.client.ClientHttpRequest |
getClientHttpRequest() |
org.springframework.http.HttpMethod |
getMethod() |
org.springframework.web.client.RequestCallback |
getRequestCallback() |
org.springframework.web.client.ResponseExtractor |
getResponseExtractor() |
URI |
getUrl() |
void |
setClientHttpRequest(org.springframework.http.client.ClientHttpRequest clientHttpRequest) |
void |
setRequestCallback(org.springframework.web.client.RequestCallback requestCallback) |
void |
setResponseExtractor(org.springframework.web.client.ResponseExtractor responseExtractor) |
void |
setUrl(URI url) |
acceptHeaderRequestCallback, delete, delete, delete, exchange, exchange, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getErrorHandler, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, getMessageConverters, getUriTemplateHandler, handleResponse, headersExtractor, headForHeaders, headForHeaders, headForHeaders, httpEntityCallback, httpEntityCallback, optionsForAllow, optionsForAllow, optionsForAllow, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put, responseEntityExtractor, setDefaultUriVariables, setErrorHandler, setMessageConverters, setUriTemplateHandler
getInterceptors, getRequestFactory, setInterceptors
public MicroserviceRestTemplate(String microserviceName, String pathToApiResource) throws URISyntaxException
URISyntaxException
public MicroserviceRestTemplate(Boolean tryToReconnect, int tryToReconnectTimes, int sleepTimeBetweenTrying, String microserviceName, String pathToApiResource) throws URISyntaxException
RestTemplate
that tried to reconnect or errortryToReconnect
- true if try to retry failed request to microsrevicetryToReconnectTimes
- number of times to try to reconnectsleepTimeBetweenTrying
- sleep in millias to try to reconnect between failed requestsURISyntaxException
protected <T> T doExecute(URI urlFake, org.springframework.http.HttpMethod method, org.springframework.web.client.RequestCallback requestCallback, org.springframework.web.client.ResponseExtractor<T> responseExtractor) throws org.springframework.web.client.RestClientException
doExecute
in class org.springframework.web.client.RestTemplate
org.springframework.web.client.RestClientException
public URI getUrl()
public void setUrl(URI url)
public org.springframework.http.HttpMethod getMethod()
public org.springframework.web.client.RequestCallback getRequestCallback()
public void setRequestCallback(org.springframework.web.client.RequestCallback requestCallback)
public org.springframework.http.client.ClientHttpRequest getClientHttpRequest()
public void setClientHttpRequest(org.springframework.http.client.ClientHttpRequest clientHttpRequest)
public org.springframework.web.client.ResponseExtractor getResponseExtractor()
public void setResponseExtractor(org.springframework.web.client.ResponseExtractor responseExtractor)
Copyright © 2016. All rights reserved.