View Javadoc

1   /* Reporter
2    * 
3    * Created on May 5, 2005
4    *
5    * Copyright (C) 2005 Internet Archive.
6    * 
7    * This file is part of the Heritrix web crawler (crawler.archive.org).
8    * 
9    * Heritrix is free software; you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser Public License as published by
11   * the Free Software Foundation; either version 2.1 of the License, or
12   * any later version.
13   * 
14   * Heritrix is distributed in the hope that it will be useful, 
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU Lesser Public License for more details.
18   * 
19   * You should have received a copy of the GNU Lesser Public License
20   * along with Heritrix; if not, write to the Free Software
21   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22   */
23  package org.archive.util;
24  
25  import java.io.IOException;
26  import java.io.PrintWriter;
27  
28  /***
29   * @author stack
30   * @version $Date: 2006-09-20 22:40:21 +0000 (Wed, 20 Sep 2006) $, $Revision: 4644 $
31   */
32  public interface Reporter {
33      /***
34       * Get an array of report names offered by this Reporter. 
35       * A name in brackets indicates a free-form String, 
36       * in accordance with the informal description inside
37       * the brackets, may yield a useful report.
38       * 
39       * @return String array of report names, empty if there is only
40       * one report type
41       */
42      public String[] getReports();
43      
44      /***
45       * Make a report of the given name to the passed-in Writer,
46       * If null, give the default report. 
47       * 
48       * @param writer to receive report
49       */
50      public void reportTo(String name, PrintWriter writer);
51      
52      /***
53       * Make a default report to the passed-in Writer. Should
54       * be equivalent to reportTo(null, writer)
55       * 
56       * @param writer to receive report
57       */
58      public void reportTo(PrintWriter writer) throws IOException;
59      
60      /***
61       * Make a single-line summary report to the passed-in writer
62       * 
63       * @param writer to receive report
64       */
65      public void singleLineReportTo(PrintWriter writer) throws IOException;
66      
67      /***
68       * Return a short single-line summary report as a String.
69       * 
70       * @return String single-line summary report
71       */
72      public String singleLineReport();
73      
74      /***
75       * Return a  legend for the single-line summary report as a String.
76       * 
77       * @return String single-line summary legend
78       */
79      public String singleLineLegend();
80  }