/** * Initializes the web client http connection settings. */ private static void initWebClientConfig(WebClientConfiguration wconf) { if (CONFIG == null) { logger.warn("Web client config was null; cannot configure web client for {}", ServerUtility.class); logger.info("FEDORA_HOME is used to configure web client; was set to {}", Constants.FEDORA_HOME); return; } if (CONFIG.getParameter("httpClientTimeoutSecs") != null) wconf.setTimeoutSecs(Integer.parseInt(CONFIG.getParameter("httpClientTimeoutSecs"))); if (CONFIG.getParameter("httpClientSocketTimeoutSecs") != null) wconf.setSockTimeoutSecs(Integer.parseInt(CONFIG.getParameter("httpClientSocketTimeoutSecs"))); if (CONFIG.getParameter("httpClientMaxConnectionsPerHost") != null) wconf.setMaxConnPerHost(Integer.parseInt(CONFIG.getParameter("httpClientMaxConnectionsPerHost"))); if (CONFIG.getParameter("httpClientMaxTotalConnections") != null) wconf.setMaxTotalConn(Integer.parseInt(CONFIG.getParameter("httpClientMaxTotalConnections"))); if (CONFIG.getParameter("httpClientFollowRedirects") != null) wconf.setFollowRedirects(Boolean.parseBoolean(CONFIG.getParameter("httpClientFollowRedirects"))); if (CONFIG.getParameter("httpClientMaxFollowRedirects") != null) wconf.setMaxRedirects(Integer.parseInt(CONFIG.getParameter("httpClientMaxFollowRedirects"))); if (CONFIG.getParameter("httpClientUserAgent") != null) wconf.setUserAgent(CONFIG.getParameter("httpClientUserAgent")); }
/** * Initializes the web client http connection settings. */ private static void initWebClientConfig(WebClientConfiguration wconf) { if (CONFIG == null) { logger.warn("Web client config was null; cannot configure web client for {}", ServerUtility.class); logger.info("FEDORA_HOME is used to configure web client; was set to {}", Constants.FEDORA_HOME); return; } if (CONFIG.getParameter("httpClientTimeoutSecs") != null) wconf.setTimeoutSecs(Integer.parseInt(CONFIG.getParameter("httpClientTimeoutSecs"))); if (CONFIG.getParameter("httpClientSocketTimeoutSecs") != null) wconf.setSockTimeoutSecs(Integer.parseInt(CONFIG.getParameter("httpClientSocketTimeoutSecs"))); if (CONFIG.getParameter("httpClientMaxConnectionsPerHost") != null) wconf.setMaxConnPerHost(Integer.parseInt(CONFIG.getParameter("httpClientMaxConnectionsPerHost"))); if (CONFIG.getParameter("httpClientMaxTotalConnections") != null) wconf.setMaxTotalConn(Integer.parseInt(CONFIG.getParameter("httpClientMaxTotalConnections"))); if (CONFIG.getParameter("httpClientFollowRedirects") != null) wconf.setFollowRedirects(Boolean.parseBoolean(CONFIG.getParameter("httpClientFollowRedirects"))); if (CONFIG.getParameter("httpClientMaxFollowRedirects") != null) wconf.setMaxRedirects(Integer.parseInt(CONFIG.getParameter("httpClientMaxFollowRedirects"))); if (CONFIG.getParameter("httpClientUserAgent") != null) wconf.setUserAgent(CONFIG.getParameter("httpClientUserAgent")); }
/** * Initializes the web client http connection settings. */ private void initWebClientConfig() { m_webClientConfig = new WebClientConfiguration(); if (getParameter("httpClientTimeoutSecs") != null) m_webClientConfig.setTimeoutSecs(Integer.parseInt(getParameter("httpClientTimeoutSecs"))); if (getParameter("httpClientSocketTimeoutSecs") != null) m_webClientConfig.setSockTimeoutSecs(Integer.parseInt(getParameter("httpClientSocketTimeoutSecs"))); if (getParameter("httpClientMaxConnectionsPerHost") != null) m_webClientConfig.setMaxConnPerHost(Integer.parseInt(getParameter("httpClientMaxConnectionsPerHost"))); if (getParameter("httpClientMaxTotalConnections") != null) m_webClientConfig.setMaxTotalConn(Integer.parseInt(getParameter("httpClientMaxTotalConnections"))); if (getParameter("httpClientFollowRedirects") != null) m_webClientConfig.setFollowRedirects(Boolean.parseBoolean(getParameter("httpClientFollowRedirects"))); if (getParameter("httpClientMaxFollowRedirects") != null) m_webClientConfig.setMaxRedirects(Integer.parseInt(getParameter("httpClientMaxFollowRedirects"))); if (getParameter("httpClientUserAgent") != null) m_webClientConfig.setUserAgent(getParameter("httpClientUserAgent")); }
/** * Initializes the web client http connection settings. */ private void initWebClientConfig() { m_webClientConfig = new WebClientConfiguration(); if (getParameter("httpClientTimeoutSecs") != null) m_webClientConfig.setTimeoutSecs(Integer.parseInt(getParameter("httpClientTimeoutSecs"))); if (getParameter("httpClientSocketTimeoutSecs") != null) m_webClientConfig.setSockTimeoutSecs(Integer.parseInt(getParameter("httpClientSocketTimeoutSecs"))); if (getParameter("httpClientMaxConnectionsPerHost") != null) m_webClientConfig.setMaxConnPerHost(Integer.parseInt(getParameter("httpClientMaxConnectionsPerHost"))); if (getParameter("httpClientMaxTotalConnections") != null) m_webClientConfig.setMaxTotalConn(Integer.parseInt(getParameter("httpClientMaxTotalConnections"))); if (getParameter("httpClientFollowRedirects") != null) m_webClientConfig.setFollowRedirects(Boolean.parseBoolean(getParameter("httpClientFollowRedirects"))); if (getParameter("httpClientMaxFollowRedirects") != null) m_webClientConfig.setMaxRedirects(Integer.parseInt(getParameter("httpClientMaxFollowRedirects"))); if (getParameter("httpClientUserAgent") != null) m_webClientConfig.setUserAgent(getParameter("httpClientUserAgent")); }