Changeset 183 for trunk/EventBenchConsole/src
- Timestamp:
- 09/14/11 19:24:58 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench
- Files:
-
- 2 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 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDparseXML.java
r171 r183 21 21 public class CMDparseXML implements Command { 22 22 23 /* (non-Javadoc) 23 /* 24 * (non-Javadoc) 25 * 24 26 * @see de.ugoe.cs.util.console.Command#help() 25 27 */ 26 28 @Override 27 29 public void help() { 28 Console.println("Usage: parseXML <filename> {< countMessageOccurences}");30 Console.println("Usage: parseXML <filename> {<sequencesName>} {<countMessageOccurences>}"); 29 31 } 30 32 31 /* (non-Javadoc) 33 /* 34 * (non-Javadoc) 35 * 32 36 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 33 37 */ … … 35 39 public void run(List<Object> parameters) { 36 40 String filename; 41 String sequencesName = "sequences"; 37 42 boolean countMessageOccurences = false; 38 43 39 44 try { 40 45 filename = (String) parameters.get(0); 41 if (parameters.size() == 2) { 46 if (parameters.size() >= 2) { 47 sequencesName = (String) parameters.get(1); 48 } 49 if (parameters.size() >= 3) { 42 50 countMessageOccurences = Boolean 43 .parseBoolean((String) parameters.get( 1));51 .parseBoolean((String) parameters.get(2)); 44 52 } 45 53 } catch (Exception e) { … … 52 60 List<List<WindowsEvent>> sequences = parser.getSequences(); 53 61 54 if (GlobalDataContainer.getInstance().addData( "sequences", sequences)) {55 Console.traceln("Old data \"" + "sequences"+ "\" overwritten");62 if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) { 63 Console.traceln("Old data \"" + sequencesName + "\" overwritten"); 56 64 } 57 65 }
Note: See TracChangeset
for help on using the changeset viewer.