@@ -0,0 +1,1039 @@
+package com.northpine.scrape;%0A%0Aimport java.util.Map;%0Aimport java.util.Optional;%0Aimport java.util.concurrent.ConcurrentHashMap;%0A%0Apublic enum JobManager %7B%0A%0A  M;%0A%0A%0A  private Map%3CString, ScrapeJob%3E jobs;%0A  private Map%3CString, Integer%3E numRequesters;%0A%0A%0A  JobManager() %7B%0A    jobs = new ConcurrentHashMap%3C%3E();%0A    numRequesters = new ConcurrentHashMap%3C%3E();%0A  %7D%0A%0A  public String submitJob(String url) %7B%0A    if(jobs.containsKey(url)) %7B%0A      numRequesters.computeIfPresent(url, (key, num) -%3E num + 1);%0A      numRequesters.putIfAbsent(url, 1);%0A      return jobs.get(url).getName();%0A    %7D%0A    else %7B%0A      ScrapeJob job = new ScrapeJob(url);%0A      jobs.put(url, job);%0A      numRequesters.put(url, 1);%0A      job.startScraping();%0A      return job.getName();%0A    %7D%0A  %7D%0A%0A%0A  public void killJob(String url) %7B%0A    if(numRequesters.containsKey(url) && numRequesters.get(url) == 1) %7B%0A      jobs.get(url).stopJob();%0A      numRequesters.remove(url);%0A    %7D%0A  %7D%0A%0A  public Optional%3CScrapeJob%3E getJob(String url) %7B%0A      return Optional.of(jobs.get(url));%0A  %7D%0A%0A%0A%7D%0A

add JobManager