public static void main(String[] args) {
      Map<String, Researcher> researchers = new HashMap<String, Researcher>();
      List<DataSource> sources = new ArrayList<DataSource>();

      try {
         researchers.put("error", new ErrorResearcher("error"));
         researchers.put("frequent", new FrequentAccessResearcher("frequent"));
         researchers.put("long_request", new LongRequestResearcher("long_request"));
         researchers.put("hex", new HexEncodingResearcher("hex"));
         researchers.put("spider", new SpiderResearcher("spider"));
         sources.add(new FileDataSource("error_log"));
         sources.add(new FileDataSource("access_log"));
         sources.add(new FileDataSource("hex_log"));
         sources.add(new FileDataSource("long_access_log"));
         sources.add(new FileDataSource("spider_log"));
      }
      catch (FileNotFoundException e) {
         e.printStackTrace();
      }

      Commander shepard = new Commander(researchers, sources);

      try {
         String input;
         Scanner sysIn = new Scanner(System.in);
         shepard.start();

         Matcher match;
         Pattern quit = Pattern.compile(QUIT_PATTERN);
         Pattern help = Pattern.compile(HELP_PATTERN);
         Pattern view = Pattern.compile(VIEW_PATTERN);
         Pattern notify = Pattern.compile(NOTIFY_PATTERN);

         while ((input = sysIn.nextLine()) != null) {
            if (quit.matcher(input).find())
               break;

            else if (help.matcher(input).find())
               System.out.println(HELP_TEXT);

            else if (view.matcher(input).find()) {
               List<ThreatResult> results = shepard.getWorstOffenders();
               System.out.println("CURRENT STATS:");

               for (ThreatResult res : results) {
                  System.out.println(res.toString());
               }
            }

            else if ((match = notify.matcher(input)).find()) {
               Integer threshold = Integer.parseInt(match.group(2));
               shepard.setThreshold(threshold);
            }
         }
      }
      catch (Exception e) {
         System.err.println("ERROR!!");
         e.printStackTrace();
      }
      finally {
         shepard.stop();
      }
   }