package de.ugoe.cs.eventbensch.jfc.commands; import java.security.InvalidParameterException; import java.util.Collection; import java.util.List; import de.ugoe.cs.eventbench.CommandHelpers; import de.ugoe.cs.eventbench.data.GlobalDataContainer; import de.ugoe.cs.eventbensch.jfc.JFCLogParser; import de.ugoe.cs.eventbensch.jfc.data.JFCEvent; import de.ugoe.cs.util.console.Command; import de.ugoe.cs.util.console.Console; /** *

* Command to parse an XML file with sessions monitored by EventBench's * JFCMonitor. *

* * @author Steffen Herbold * @version 1.0 */ public class CMDparseJFC implements Command { /* * (non-Javadoc) * * @see de.ugoe.cs.util.console.Command#run(java.util.List) */ @Override public void run(List parameters) { String filename; String sequencesName = "sequences"; try { filename = (String) parameters.get(0); if (parameters.size() >= 2) { sequencesName = (String) parameters.get(1); } } catch (Exception e) { throw new InvalidParameterException(); } JFCLogParser parser = new JFCLogParser(); parser.parseFile(filename); Collection> sequences = parser.getSequences(); if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) { CommandHelpers.dataOverwritten(sequencesName); } } /* * (non-Javadoc) * * @see de.ugoe.cs.util.console.Command#help() */ @Override public void help() { Console.println("Usage: parseJFC {}"); } }