1 | package de.ugoe.cs.eventbench.web.commands;
|
---|
2 |
|
---|
3 | import java.io.FileNotFoundException;
|
---|
4 | import java.io.IOException;
|
---|
5 | import java.security.InvalidParameterException;
|
---|
6 | import java.text.ParseException;
|
---|
7 | import java.util.List;
|
---|
8 |
|
---|
9 | import de.ugoe.cs.eventbench.data.GlobalDataContainer;
|
---|
10 | import de.ugoe.cs.eventbench.web.WeblogParser;
|
---|
11 | import de.ugoe.cs.util.console.Command;
|
---|
12 | import de.ugoe.cs.util.console.Console;
|
---|
13 |
|
---|
14 | public class CMDloadSessionsFromClickstream implements Command {
|
---|
15 |
|
---|
16 | @Override
|
---|
17 | public void run(List<Object> parameters) {
|
---|
18 | // TODO Auto-generated method stub
|
---|
19 | if( parameters.size() < 1 ) {
|
---|
20 | throw new InvalidParameterException();
|
---|
21 | }
|
---|
22 | String source = (String) parameters.get(0);
|
---|
23 |
|
---|
24 | WeblogParser parser = new WeblogParser();
|
---|
25 | try {
|
---|
26 | parser.parseFile(source);
|
---|
27 | } catch (FileNotFoundException e) {
|
---|
28 | Console.println(e.getMessage());
|
---|
29 | } catch (IOException e) {
|
---|
30 | Console.println(e.getMessage());
|
---|
31 | } catch (ParseException e) {
|
---|
32 | Console.println("Invalid format of date stamps.");
|
---|
33 | Console.println(e.getMessage());
|
---|
34 | }
|
---|
35 |
|
---|
36 | GlobalDataContainer.getInstance().addData("sequences", parser.getSequences());
|
---|
37 | }
|
---|
38 |
|
---|
39 | @Override
|
---|
40 | public void help() {
|
---|
41 | // TODO Auto-generated method stub
|
---|
42 |
|
---|
43 | }
|
---|
44 |
|
---|
45 | }
|
---|