/** * Get a ClientConfig object which contains exchange-specific timeout values * (<i>httpConnTimeout</i> and <i>httpReadTimeout</i>) if they were present in the * ExchangeSpecification of this instance. Subclasses are encouraged to use this config object * when creating a RestCU proxy. * * @return a rescu client config object */ public ClientConfig getClientConfig() { ClientConfig rescuConfig = new ClientConfig(); // create default rescu config // set per exchange connection- and read-timeout (if they have been set in the // ExchangeSpecification) int customHttpConnTimeout = exchange.getExchangeSpecification().getHttpConnTimeout(); if (customHttpConnTimeout > 0) { rescuConfig.setHttpConnTimeout(customHttpConnTimeout); } int customHttpReadTimeout = exchange.getExchangeSpecification().getHttpReadTimeout(); if (customHttpReadTimeout > 0) { rescuConfig.setHttpReadTimeout(customHttpReadTimeout); } if (exchange.getExchangeSpecification().getProxyHost() != null) { rescuConfig.setProxyHost(exchange.getExchangeSpecification().getProxyHost()); } if (exchange.getExchangeSpecification().getProxyPort() != null) { rescuConfig.setProxyPort(exchange.getExchangeSpecification().getProxyPort()); } return rescuConfig; }
/** * Get a ClientConfig object which contains exchange-specific timeout values * (<i>httpConnTimeout</i> and <i>httpReadTimeout</i>) if they were present in the * ExchangeSpecification of this instance. Subclasses are encouraged to use this config object * when creating a RestCU proxy. * * @return a rescu client config object */ public ClientConfig getClientConfig() { ClientConfig rescuConfig = new ClientConfig(); // create default rescu config // set per exchange connection- and read-timeout (if they have been set in the // ExchangeSpecification) int customHttpConnTimeout = exchange.getExchangeSpecification().getHttpConnTimeout(); if (customHttpConnTimeout > 0) { rescuConfig.setHttpConnTimeout(customHttpConnTimeout); } int customHttpReadTimeout = exchange.getExchangeSpecification().getHttpReadTimeout(); if (customHttpReadTimeout > 0) { rescuConfig.setHttpReadTimeout(customHttpReadTimeout); } if (exchange.getExchangeSpecification().getProxyHost() != null) { rescuConfig.setProxyHost(exchange.getExchangeSpecification().getProxyHost()); } if (exchange.getExchangeSpecification().getProxyPort() != null) { rescuConfig.setProxyPort(exchange.getExchangeSpecification().getProxyPort()); } return rescuConfig; }