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; }
status != HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE) { if (wconfig.getFollowRedirects() && 300 <= status && status <= 399) { int count = 1; while (300 <= status && status <= 399
status != HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE) { if (wconfig.getFollowRedirects() && 300 <= status && status <= 399) { int count = 1; while (300 <= status && status <= 399