private void setInputURI(Configuration conf, CRLFetcher fetcher) throws URISyntaxException { String inputURI = conf.get(CommonConfigurationKeys.HOPS_CRL_INPUT_URI_KEY); fetcher.setInputURI(new URI(inputURI)); } }
private void setOutputURI(Configuration conf, CRLFetcher fetcher) throws URISyntaxException { String outputString = conf.get(CommonConfigurationKeys.HOPS_CRL_OUTPUT_FILE_KEY, CommonConfigurationKeys.HOPS_CRL_OUTPUT_FILE_DEFAULT); URI outputURI = new URI(outputString); // If scheme is missing, assume it is the local filesystem if (outputURI.getScheme() == null) { outputURI = new URI("file://" + outputString); } fetcher.setOutputURI(outputURI); }
@Override public void run() { LOG.debug("Starting CRL fetcher thread"); while (!Thread.currentThread().isInterrupted()) { try { if (!init) { intervalTimeUnit.sleep(fetcherInterval); } else { init = false; } crlFetcher.fetch(); numberOfFailures = 0; readySignal.countDown(); } catch (IOException ex) { numberOfFailures++; if (numberOfFailures > 5) { LOG.error("Failed to fetch CRL more than 5 times. Stopping fetcher thread", ex); Thread.currentThread().interrupt(); } } catch (InterruptedException ex) { LOG.info("CRL fetcher thread is terminating...", ex); Thread.currentThread().interrupt(); } } LOG.info("CRL fetcher thread terminated"); } }