Omaha #3570 http client API changes

Change-Id: Icb6dc44e7841961da3df383e879acf4ef8f1a14f

Former-commit-id: d4edd51d41a306010a7fec2a7ed2c0cd6186506a
This commit is contained in:
Brian Clements 2014-09-04 13:11:07 -05:00
parent 40a1936b20
commit 8489ce1214
2 changed files with 16 additions and 5 deletions

View file

@ -25,6 +25,7 @@ import org.apache.commons.collections.map.DefaultedMap;
import org.eclipse.jface.preference.IPreferenceStore;
import com.raytheon.uf.common.comm.HttpClient;
import com.raytheon.uf.common.comm.HttpClientConfigBuilder;
import com.raytheon.uf.common.localization.msgs.GetServersResponse;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -60,6 +61,7 @@ import com.raytheon.uf.viz.thinclient.ui.ThinClientConnectivityDialog;
* Feb 04, 2014 2704 njensen Single proxy address/preference
* May 19, 2014 3164 bsteffen Disable request compression if it
* doesn't work.
* Sep 05, 2014 3570 bclement HTTP client API changes
*
* </pre>
*
@ -82,7 +84,11 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
@Override
protected void setupServers() throws VizException {
HttpClient.getInstance().setGzipResponseHandling(true);
HttpClient httpClient = HttpClient.getInstance();
HttpClientConfigBuilder confBuilder = new HttpClientConfigBuilder(
httpClient.getConfig());
confBuilder.setHandlingGzipResponses(true);
HttpClient.configureGlobalInstance(confBuilder.build());
if (promptUI) {
ThinClientConnectivityDialog dlg = new ThinClientConnectivityDialog(
checkAlertviz);

View file

@ -101,13 +101,18 @@
</bean>
-->
<bean id="httpClient" class="com.raytheon.uf.common.comm.HttpClient" factory-method="getInstance">
<property name="maxConnectionsPerHost" value="${PYPIES_MAX_CONN}"/>
<bean id="httpClientConfigBuilder" class="com.raytheon.uf.common.comm.HttpClientConfigBuilder">
<property name="maxConnections" value="${PYPIES_MAX_CONN}"/>
<!-- value in milliseconds to allow socket to timeout, don't allow this to be zero, bad things could happen -->
<property name="socketTimeout" value="180000"/>
<property name="compressRequests" value="false"/>
<property name="gzipResponseHandling" value="false"/>
<property name="handlingGzipResponses" value="false"/>
</bean>
<bean id="httpClientConfig" factory-bean="httpClientConfigBuilder" factory-method="build"/>
<bean id="httpClient" class="com.raytheon.uf.common.comm.HttpClient" factory-method="configureGlobalInstance">
<constructor-arg ref="httpClientConfig"/>
</bean>
<bean id="pypiesStoreProps" class="com.raytheon.uf.common.pypies.PypiesProperties">
<property name="address" value="${PYPIES_SERVER}" />