01: //LogParser.java
02: //-------------------------------------
03: //part of YACY
04: //(C) by Michael Peter Christen; mc@anomic.de
05: //first published on http://www.anomic.de
06: //Frankfurt, Germany, 2004
07: //
08: //This file ist contributed by Matthias Soehnholz
09: //last major change: $LastChangedDate: 2008-01-06 19:23:38 +0000 (So, 06 Jan 2008) $ by $LastChangedBy: orbiter $
10: //Revision: $LastChangedRevision: 4305 $
11: //
12: //This program is free software; you can redistribute it and/or modify
13: //it under the terms of the GNU General Public License as published by
14: //the Free Software Foundation; either version 2 of the License, or
15: //(at your option) any later version.
16: //
17: //This program is distributed in the hope that it will be useful,
18: //but WITHOUT ANY WARRANTY; without even the implied warranty of
19: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20: //GNU General Public License for more details.
21: //
22: //You should have received a copy of the GNU General Public License
23: //along with this program; if not, write to the Free Software
24: //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25: //
26: //Using this software in any meaning (reading, learning, copying, compiling,
27: //running) means that you agree that the Author(s) is (are) not responsible
28: //for cost, loss of data or any harm that may be caused directly or indirectly
29: //by usage of this softare or this documentation. The usage of this software
30: //is on your own risk. The installation and usage (starting/running) of this
31: //software may allow other people or application to access your computer and
32: //any attached devices and is highly dependent on the configuration of the
33: //software which must be done by the user of the software; the author(s) is
34: //(are) also not responsible for proper configuration and usage of the
35: //software, even if provoked by documentation provided together with
36: //the software.
37: //
38: //Any changes to this file according to the GPL as documented in the file
39: //gpl.txt aside this file in the shipment you received can be done to the
40: //lines that follows this copyright notice here, but changes must not be
41: //done inside the copyright notive above. A re-distribution must contain
42: //the intact and unchanged copyright notice.
43: //Contributions and changes to the program code must be marked as such.
44:
45: package de.anomic.server.logging.logParsers;
46:
47: import java.util.Hashtable;
48:
49: /**
50: * This is the logParser-Interface which all yacy Logalizer-Parser must
51: * implement.
52: */
53: public interface LogParser {
54: /**
55: * This is the basic parser-method to parse single loglines. It can
56: * request to give the current logLine and a number of additional logLines,
57: * defined by the return value, to be passed over to the
58: * <tt>advancedParse</tt>-method. The method should return -1 if the given
59: * line was not processed.
60: *
61: * TODO: description of logLevels
62: *
63: * @param logLevel The LogLevel of the line to analyze.
64: * @param logLine The line to be analyze by the parser.
65: * @return number of additional lines to be loaded and passed over to the
66: * <tt>advancedParse</tt>-method, or if the line was not processed by the
67: * parser "-1".
68: */
69: public int parse(String logLevel, String logLine);
70:
71: /**
72: * This method prints the Parser-Results to the standard-output.
73: */
74: public void printResults();
75:
76: /**
77: * The return value defines which logLines the parser will handle.
78: * @return a String that defines the logLines to analyze. For example
79: * <b>PLASMA</b> or <b>YACY</b>
80: */
81: public String getParserType();
82:
83: public Hashtable<String, Object> getResults();
84:
85: public double getParserVersion();
86: }
|