All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.capitalone.dashboard.client.DefaultRestOperationsSupplier Maven / Gradle / Ivy

There is a newer version: 4.0.2
Show newest version
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