LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """This file contains the output module interface classes.""" | 2 """This file contains the output module interface classes.""" |
3 | 3 |
4 import abc | 4 import abc |
5 import logging | 5 import logging |
6 | 6 |
7 from plaso.lib import errors | 7 from plaso.lib import errors |
8 | 8 |
9 | 9 |
10 class OutputModule(object): | 10 class OutputModule(object): |
11 """Class that implements the output module object interface.""" | 11 """Class that implements the output module object interface.""" |
12 | 12 |
13 NAME = u'' | 13 NAME = u'' |
14 DESCRIPTION = u'' | 14 DESCRIPTION = u'' |
15 | 15 |
16 def __init__(self, output_mediator): | 16 def __init__(self, output_mediator): |
17 """Initializes the output module object. | 17 """Initializes an output module. |
18 | 18 |
19 Args: | 19 Args: |
20 output_mediator (OutputMediator): mediates interactions between output | 20 output_mediator (OutputMediator): mediates interactions between output |
21 modules and other components, such as storage and dfvfs. | 21 modules and other components, such as storage and dfvfs. |
22 | 22 |
23 Raises: | 23 Raises: |
24 ValueError: when there are unused keyword arguments. | 24 ValueError: when there are unused keyword arguments. |
25 """ | 25 """ |
26 super(OutputModule, self).__init__() | 26 super(OutputModule, self).__init__() |
27 self._output_mediator = output_mediator | 27 self._output_mediator = output_mediator |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 """Writes the end of an event to the output. | 93 """Writes the end of an event to the output. |
94 | 94 |
95 Can be used for post-processing or output after an individual event | 95 Can be used for post-processing or output after an individual event |
96 has been written, such as writing closing XML tags, etc. | 96 has been written, such as writing closing XML tags, etc. |
97 """ | 97 """ |
98 pass | 98 pass |
99 | 99 |
100 def WriteEventMACBGroup(self, event_macb_group): | 100 def WriteEventMACBGroup(self, event_macb_group): |
101 """Writes an event MACB group to the output. | 101 """Writes an event MACB group to the output. |
102 | 102 |
| 103 An event MACB group is a group of events that have the same timestamp and |
| 104 event data (attributes and values), where the timestamp description (or |
| 105 usage) is one or more of MACB (modification, access, change, birth). |
| 106 |
| 107 This function is called if the psort engine detected an event MACB group |
| 108 so that the output module, if supported, can represent the group as |
| 109 such. If not overridden this function will output every event individually. |
| 110 |
103 Args: | 111 Args: |
104 event_macb_group (list[EventObject]): event MACB group. | 112 event_macb_group (list[EventObject]): group of events with identical |
| 113 timestamps, attributes and values. |
105 """ | 114 """ |
106 for event in event_macb_group: | 115 for event in event_macb_group: |
107 self.WriteEvent(event) | 116 self.WriteEvent(event) |
108 | 117 |
109 def WriteEventStart(self): | 118 def WriteEventStart(self): |
110 """Writes the start of an event to the output. | 119 """Writes the start of an event to the output. |
111 | 120 |
112 Can be used for pre-processing or output before an individual event | 121 Can be used for pre-processing or output before an individual event |
113 has been written, such as writing opening XML tags, etc. | 122 has been written, such as writing opening XML tags, etc. |
114 """ | 123 """ |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 """Set the output writer. | 173 """Set the output writer. |
165 | 174 |
166 Args: | 175 Args: |
167 output_writer (CLIOutputWriter): output writer. | 176 output_writer (CLIOutputWriter): output writer. |
168 """ | 177 """ |
169 self._output_writer = output_writer | 178 self._output_writer = output_writer |
170 | 179 |
171 def Close(self): | 180 def Close(self): |
172 """Closes the output.""" | 181 """Closes the output.""" |
173 self._output_writer = None | 182 self._output_writer = None |
LEFT | RIGHT |