source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDparseXML.java @ 80

Last change on this file since 80 was 77, checked in by sherbold, 13 years ago

+ introduced de.ugoe.cs.eventbench.windows.WindowsEvent?

File size: 1.1 KB
Line 
1package de.ugoe.cs.eventbench.windows.commands;
2
3import java.security.InvalidParameterException;
4import java.util.List;
5
6import de.ugoe.cs.eventbench.data.GlobalDataContainer;
7import de.ugoe.cs.eventbench.windows.LogParser;
8import de.ugoe.cs.eventbench.windows.WindowsEvent;
9import de.ugoe.cs.util.console.Command;
10import de.ugoe.cs.util.console.Console;
11
12public class CMDparseXML implements Command {
13
14        @Override
15        public void help() {
16                Console.println("Usage: parseXML <filename> {<countMessageOccurences}");
17        }
18
19        @Override
20        public void run(List<Object> parameters) {
21                String filename;
22                boolean countMessageOccurences = false;
23               
24                try {
25                        filename = (String) parameters.get(0);
26                        if( parameters.size()==2 ) {
27                                countMessageOccurences = Boolean.parseBoolean((String) parameters.get(1));
28                        }
29                } catch (Exception e) {
30                        throw new InvalidParameterException();
31                }
32               
33                LogParser parser = new LogParser(countMessageOccurences);
34                parser.parseFile(filename);
35               
36                List<List<WindowsEvent>> sequences = parser.getSequences();
37               
38                GlobalDataContainer.getInstance().addData("sequences", sequences);             
39        }
40
41}
Note: See TracBrowser for help on using the repository browser.