com.capitalone.dashboard.client.DefaultRestOperationsSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Core package shared by API layer and Microservices
package com.capitalone.dashboard.client;
import com.capitalone.dashboard.util.HygieiaRestConnection;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestOperations;
import org.springframework.web.client.RestTemplate;
/**
* Supplier that returns an instance of RestOperations
*/
@Component
public class DefaultRestOperationsSupplier implements RestOperationsSupplier {
@Override
public RestOperations get() {
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setConnectTimeout(Integer.getInteger(HygieiaRestConnection.REST_CONNECT_TIMEOUT, 5000));
requestFactory.setReadTimeout(Integer.getInteger(HygieiaRestConnection.REST_READ_TIMEOUT, 60000));
return new RestTemplate(requestFactory);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy