Different kinds of log files are parsed by a collection of objects
[gnucomo.git] / src / gcm_input / line_cooker.h
1
2 /**************************************************************************
3 **  (c) Copyright 2002, Andromeda Technology & Automation
4 ** This is free software; you can redistribute it and/or modify it under the
5 ** terms of the GNU General Public License, see the file COPYING.
6 ***************************************************************************
7 ** MODULE INFORMATION *
8 ***********************
9 **      FILE NAME      : line_cooker.h
10 **      SYSTEM NAME    : 
11 **      VERSION NUMBER : $Revision: 1.1 $
12 **
13 **  DESCRIPTION      :  The line_cooker abstract base class.
14 **                      Defines the interface for a collection of derived
15 **                      classes the parse different kinds of logs.
16 **
17 **  EXPORTED OBJECTS : 
18 **  LOCAL    OBJECTS : 
19 **  MODULES  USED    :
20 ***************************************************************************
21 **  ADMINISTRATIVE INFORMATION *
22 ********************************
23 **      ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
24 **      CREATION DATE   : Aug 06, 2003
25 **      LAST UPDATE     : Aug 06, 2003
26 **      MODIFICATIONS   : 
27 **************************************************************************/
28
29 /*****************************
30    $Log: line_cooker.h,v $
31    Revision 1.1  2003-08-11 16:56:16  arjen
32    Different kinds of log files are parsed by a collection of objects
33    of different classes, derived from the base class line_cooker
34    Depending on the message content or the message_type element in
35    XML, one of these objects is selected.
36
37    Logrunner is integrated with gcm_input. Although its functionality
38    is still limited, a connection between logrunner and gcm_input
39    is beginning to form.
40
41 *****************************/
42
43 /* static const char *RCSID = "$Id: line_cooker.h,v 1.1 2003-08-11 16:56:16 arjen Exp $"; */
44
45 #ifndef LINE_COOKER_H
46 #define LINE_COOKER_H
47
48 #include <AXE/String.h>
49 #include <AXE/date.h>
50
51 /*
52 ///////////////////////////////////////////////////////////////////////////
53 //  NAME           : line_cooker
54 //  BASECLASS      : 
55 //  MEMBERS        :
56 //  OPERATORS      :
57 //  METHODS        : 
58 //
59 //  DESCRIPTION    : 
60 //
61 //  RELATIONS      :
62 //  SEE ALSO       :
63 //  LAST MODIFIED  : Aug 06, 2003
64 ///////////////////////////////////////////////////////////////////////////
65 */
66
67 class line_cooker
68 {
69
70 protected:
71
72    UTC    ts;     //    the timestamp.
73    String hn;     //    the hostname
74    String srv;    //    the service
75
76 public:
77
78    line_cooker()
79    {
80    }
81
82    virtual bool check_pattern(String logline) = 0;
83    virtual bool cook_this(String logline, UTC arrival) = 0;
84
85    virtual String message_type() = 0;
86
87    UTC timestamp()
88    {
89       return ts;
90    }
91
92    String hostname()
93    {
94       return hn;
95    }
96
97    String service()
98    {
99       return srv;
100    }
101 };
102
103 #endif // LINE_COOKER_H