- Timestamp:
- 09/14/11 19:24:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/commands/CMDloadSessionsFromClickstream.java
r177 r183 16 16 * Command to load sessions from a web log. 17 17 * </p> 18 * 18 19 * @author Steffen Herbold 19 20 * @version 1.0 … … 21 22 public class CMDloadSessionsFromClickstream implements Command { 22 23 23 /* (non-Javadoc) 24 /* 25 * (non-Javadoc) 26 * 24 27 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 25 28 */ 26 29 @Override 27 30 public void run(List<Object> parameters) { 28 if ( parameters.size() < 1) {31 if (parameters.size() < 1) { 29 32 throw new InvalidParameterException(); 30 33 } … … 32 35 int timeout = -1; 33 36 int minLength = -1; 34 if( parameters.size() ==3 ) { 37 String sequencesName = "sequences"; 38 if (parameters.size() >= 3) { 35 39 timeout = Integer.parseInt((String) parameters.get(1)); 36 40 minLength = Integer.parseInt((String) parameters.get(2)); 37 41 } 38 42 if (parameters.size() >= 4) { 43 sequencesName = (String) parameters.get(3); 44 } 45 39 46 WeblogParser parser = new WeblogParser(); 40 if ( timeout!=-1) {47 if (timeout != -1) { 41 48 parser.setTimeout(timeout); 42 49 parser.setMinLength(minLength); … … 51 58 Console.println("Invalid format of date stamps."); 52 59 Console.println(e.getMessage()); 53 } 54 55 if( GlobalDataContainer.getInstance().addData("sequences", parser.getSequences()) ) { 56 Console.traceln("Old data \"" + "sequences" + "\" overwritten"); 60 } 61 62 if (GlobalDataContainer.getInstance().addData(sequencesName, 63 parser.getSequences())) { 64 Console.traceln("Old data \"" + sequencesName + "\" overwritten"); 57 65 } 58 66 } 59 60 /* (non-Javadoc) 67 68 /* 69 * (non-Javadoc) 70 * 61 71 * @see de.ugoe.cs.util.console.Command#help() 62 72 */ 63 73 @Override 64 74 public void help() { 65 Console.println("Usage: loadSessionsFromClickstream <filename> {<timeout> <minSessionLength>} ");75 Console.println("Usage: loadSessionsFromClickstream <filename> {<timeout> <minSessionLength>} {<sequencesName>}"); 66 76 } 67 77
Note: See TracChangeset
for help on using the changeset viewer.