}
}
private RestTemplate createRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
CommonsClientHttpRequestFactory requestFactory = new CommonsClientHttpRequestFactory();
requestFactory.setConnectTimeout(TIMEOUT);
requestFactory.setReadTimeout(TIMEOUT);
if (httpProxyConfiguration != null) {
requestFactory.getHttpClient().getHostConfiguration().setProxy(httpProxyConfiguration.getProxyHost(),
httpProxyConfiguration.getProxyPort());
}
restTemplate.setRequestFactory(requestFactory);
return restTemplate;
}