use of com.adobe.target.edge.client.http.TargetMetrics in project target-java-sdk by adobe.
the class DefaultGeoClient method start.
public void start(ClientConfig clientConfig) {
this.geoUrl = "https://" + clientConfig.getOnDeviceConfigHostname() + GEO_PATH;
unirestInstance.config().socketTimeout(clientConfig.getSocketTimeout()).connectTimeout(clientConfig.getConnectTimeout()).concurrency(clientConfig.getMaxConnectionsTotal(), clientConfig.getMaxConnectionsPerHost()).automaticRetries(clientConfig.isEnabledRetries()).enableCookieManagement(false);
if (clientConfig.isLogRequestStatus()) {
unirestInstance.config().instrumentWith(new TargetMetrics(new LoggingMetricConsumer()));
}
if (clientConfig.isProxyEnabled()) {
ClientProxyConfig proxyConfig = clientConfig.getProxyConfig();
if (proxyConfig.isAuthProxy()) {
unirestInstance.config().proxy(proxyConfig.getHost(), proxyConfig.getPort(), proxyConfig.getUsername(), proxyConfig.getPassword());
} else {
unirestInstance.config().proxy(proxyConfig.getHost(), proxyConfig.getPort());
}
}
}
Aggregations