Search in sources :

Example 1 with LoggingInterceptor

use of org.eclipse.vorto.repository.utils.LoggingInterceptor in project vorto by eclipse.

the class RepositoryConfiguration method restTemplate.

@Bean
public RestTemplate restTemplate() {
    RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory()));
    List<ClientHttpRequestInterceptor> interceptors = new ArrayList<>();
    interceptors.add(new LoggingInterceptor());
    restTemplate.setInterceptors(interceptors);
    restTemplate.getMessageConverters().add(new ByteArrayHttpMessageConverter());
    return restTemplate;
}
Also used : SimpleClientHttpRequestFactory(org.springframework.http.client.SimpleClientHttpRequestFactory) LoggingInterceptor(org.eclipse.vorto.repository.utils.LoggingInterceptor) RestTemplate(org.springframework.web.client.RestTemplate) ArrayList(java.util.ArrayList) ByteArrayHttpMessageConverter(org.springframework.http.converter.ByteArrayHttpMessageConverter) ClientHttpRequestInterceptor(org.springframework.http.client.ClientHttpRequestInterceptor) BufferingClientHttpRequestFactory(org.springframework.http.client.BufferingClientHttpRequestFactory) Bean(org.springframework.context.annotation.Bean)

Aggregations

ArrayList (java.util.ArrayList)1 LoggingInterceptor (org.eclipse.vorto.repository.utils.LoggingInterceptor)1 Bean (org.springframework.context.annotation.Bean)1 BufferingClientHttpRequestFactory (org.springframework.http.client.BufferingClientHttpRequestFactory)1 ClientHttpRequestInterceptor (org.springframework.http.client.ClientHttpRequestInterceptor)1 SimpleClientHttpRequestFactory (org.springframework.http.client.SimpleClientHttpRequestFactory)1 ByteArrayHttpMessageConverter (org.springframework.http.converter.ByteArrayHttpMessageConverter)1 RestTemplate (org.springframework.web.client.RestTemplate)1