private PoolingClientConnectionManager configureConnectionManager( WebClientConfiguration wconfig){ logger.debug("User-Agent is '" + wconfig.getUserAgent() + "'"); logger.debug("Max total connections is " + wconfig.getMaxTotalConn()); logger.debug("Max connections per host is " + wconfig.getMaxConnPerHost()); logger.debug("Connection timeout is " + wconfig.getTimeoutSecs()); logger.debug("Socket Connection timeout is " + wconfig.getSockTimeoutSecs()); logger.debug("Follow redirects? " + wconfig.getFollowRedirects()); logger.debug("Max number of redirects to follow is " + wconfig.getMaxRedirects()); PoolingClientConnectionManager cManager = new PoolingClientConnectionManager(); cManager.setDefaultMaxPerRoute(wconfig.getMaxConnPerHost()); cManager.setMaxTotal(wconfig.getMaxTotalConn()); //TODO pick the ports up from configuration cManager.getSchemeRegistry().register( new Scheme("https", 443, SSLSocketFactory.getSocketFactory())); cManager.getSchemeRegistry().register( new Scheme("http", 80, PlainSocketFactory.getSocketFactory())); return cManager; }
private PoolingClientConnectionManager configureConnectionManager( WebClientConfiguration wconfig){ logger.debug("User-Agent is '" + wconfig.getUserAgent() + "'"); logger.debug("Max total connections is " + wconfig.getMaxTotalConn()); logger.debug("Max connections per host is " + wconfig.getMaxConnPerHost()); logger.debug("Connection timeout is " + wconfig.getTimeoutSecs()); logger.debug("Socket Connection timeout is " + wconfig.getSockTimeoutSecs()); logger.debug("Follow redirects? " + wconfig.getFollowRedirects()); logger.debug("Max number of redirects to follow is " + wconfig.getMaxRedirects()); PoolingClientConnectionManager cManager = new PoolingClientConnectionManager(); cManager.setDefaultMaxPerRoute(wconfig.getMaxConnPerHost()); cManager.setMaxTotal(wconfig.getMaxTotalConn()); //TODO pick the ports up from configuration cManager.getSchemeRegistry().register( new Scheme("https", 443, SSLSocketFactory.getSocketFactory())); cManager.getSchemeRegistry().register( new Scheme("http", 80, PlainSocketFactory.getSocketFactory())); return cManager; }
if (m_httpconfig.getUserAgent() == null ) { m_httpconfig.setUserAgent(m_userAgent);
if (m_httpconfig.getUserAgent() == null ) { m_httpconfig.setUserAgent(m_userAgent);
HttpClient client; setHeaders(request, wconfig.getUserAgent(), ifNoneMatch, ifModifiedSince, range); if (creds != null && creds.getUserName() != null && creds.getUserName().length() > 0) { setHeaders(request, wconfig.getUserAgent(), ifNoneMatch, ifModifiedSince, range); in = new HttpInputStream(client, request); status = in.getStatusCode();
HttpClient client; setHeaders(request, wconfig.getUserAgent(), ifNoneMatch, ifModifiedSince, range); if (creds != null && creds.getUserName() != null && creds.getUserName().length() > 0) { setHeaders(request, wconfig.getUserAgent(), ifNoneMatch, ifModifiedSince, range); in = new HttpInputStream(client, request); status = in.getStatusCode();