Changeset 566 for trunk/quest-ui-core/src
- Timestamp:
- 08/17/12 10:22:43 (12 years ago)
- Location:
- trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/plugin/mfc
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/plugin/mfc/EventGenerator.java
r488 r566 18 18 19 19 import de.ugoe.cs.quest.eventcore.Event; 20 import de.ugoe.cs.quest.plugin.mfc.eventcore.MFCEventTarget; 21 import de.ugoe.cs.quest.plugin.mfc.eventcore.MFCEventType; 20 22 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowTree; 21 23 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowTreeNode; 22 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowsEvent;23 24 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowsMessage; 24 25 import de.ugoe.cs.util.console.Console; … … 81 82 * </p> 82 83 */ 83 private WindowsEvent currentToken; 84 private Event currentToken; 85 86 /** 87 * <p> 88 * Event type of the current token. Stored as a member to be able to update it during the parsing of the idinfo tag. 89 * </p> 90 */ 91 private MFCEventType currentType; 84 92 85 93 /** … … 132 140 */ 133 141 @SuppressWarnings("unchecked") 134 public WindowsEvent generateEvent(List<WindowsMessage> sequence) {142 public Event generateEvent(List<WindowsMessage> sequence) { 135 143 Document rulesDoc = getDocument(rulesFile); 136 144 Element rulesRoot = rulesDoc.getRootElement(); … … 144 152 Element currentRule = ruleElements.get(ruleIndex); 145 153 currentRuleName = currentRule.getAttributeValue("name"); 146 currentToken = new WindowsEvent(currentRuleName); 147 currentToken.setDecorator(MFCReplayDecorator.getInstance()); 154 currentType = new MFCEventType(currentRuleName); 155 currentToken = new Event(currentType); 156 148 157 isMatch = true; 149 158 messageStorage = new HashMap<String, Object>(); … … 183 192 } catch (InvalidParameterException e) { 184 193 Console.printerrln(e.getMessage()); 185 currentToken.invalidateReplay();194 // TODO currentToken.invalidateReplay(); 186 195 } 187 196 } else if (genMsgElement.getName().equals("genMsgSeq")) { 188 197 try { 189 198 generateReplaySequence(genMsgElement); 190 currentToken.invalidateReplay();199 // TODO currentToken.invalidateReplay(); 191 200 } catch (InvalidParameterException e) { 192 201 Console.printerrln(e.getMessage()); 193 currentToken.invalidateReplay();202 // TODO currentToken.invalidateReplay(); 194 203 } 195 204 } … … 200 209 // cannot be empty if document is valid 201 210 List<Element> valueElements = idinfoElement.getChildren(); 202 currentT oken.setIdInfo(getTermValue(null,211 currentType.setInfo(getTermValue(null, 203 212 valueElements.get(0))); 204 213 } 205 Console.traceln(currentRule.getAttributeValue("name") 206 + currentToken.getIdInfo() + " matched"); 214 Console.traceln(currentToken.getType().toString() + " matched"); 207 215 } else { 208 216 currentToken = null; … … 249 257 if (isMatch) { 250 258 handleStorage(messageElement, currentMessage); 251 currentToken.setTarget(currentMessage 252 .getXmlWindowDescription()); 253 currentToken 254 .setTargetShort(currentMessage.getParentNames()); 259 currentToken.setTarget(new MFCEventTarget(currentMessage 260 .getXmlWindowDescription())); 261 // TODO currentToken.setTargetShort(currentMessage.getParentNames()); 255 262 } 256 263 } … … 298 305 if (isCurrentMatch) { 299 306 handleStorage(messageElement, currentMessage); 300 currentToken.setTarget(currentMessage 301 .getXmlWindowDescription()); 302 currentToken 303 .setTargetShort(currentMessage.getParentNames()); 307 currentToken.setTarget(new MFCEventTarget(currentMessage 308 .getXmlWindowDescription())); 309 // TODO currentToken.setTargetShort(currentMessage.getParentNames()); 304 310 } 305 311 } … … 516 522 generatedMessage.setDelay(delay); 517 523 } else { 518 currentToken.invalidateReplay();519 } 520 currentToken.addReplay Event(generatedMessage);524 // TODO currentToken.invalidateReplay(); 525 } 526 currentToken.addReplayable(generatedMessage); 521 527 } 522 528 … … 568 574 } 569 575 } 570 currentToken.addReplay Sequence(generatedMessageSeq);576 currentToken.addReplayableSequence(generatedMessageSeq); 571 577 } 572 578 -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/plugin/mfc/MFCLogParser.java
r488 r566 23 23 import org.xml.sax.helpers.DefaultHandler; 24 24 25 import de.ugoe.cs.quest.eventcore.Event; 25 26 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowTree; 26 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowsEvent;27 27 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowsMessage; 28 28 import de.ugoe.cs.util.StringTools; … … 71 71 * </p> 72 72 */ 73 private Collection<List< WindowsEvent>> sequences;73 private Collection<List<Event>> sequences; 74 74 75 75 /** … … 110 110 public MFCLogParser(boolean countMessageOccurences) { 111 111 sequenceSplitter = new SequenceSplitter(); 112 sequences = new LinkedList<List< WindowsEvent>>();112 sequences = new LinkedList<List<Event>>(); 113 113 currentHandler = null; 114 114 this.countMessageOccurences = countMessageOccurences; … … 127 127 * @return collection of event sequences 128 128 */ 129 public Collection<List< WindowsEvent>> getSequences() {129 public Collection<List<Event>> getSequences() { 130 130 return sequences; 131 131 } … … 209 209 } else if (qName.equals("session")) { 210 210 sequenceSplitter.endSession(); 211 List< WindowsEvent> seq = sequenceSplitter.getSequence();211 List<Event> seq = sequenceSplitter.getSequence(); 212 212 if( seq!=null && !seq.isEmpty() ) { 213 213 sequences.add(seq); -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/plugin/mfc/SequenceSplitter.java
r488 r566 5 5 6 6 import de.ugoe.cs.quest.eventcore.Event; 7 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowsEvent;8 7 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowsMessage; 9 8 import de.ugoe.cs.util.console.Console; … … 57 56 * </p> 58 57 */ 59 private List< WindowsEvent> actionSequence;58 private List<Event> actionSequence; 60 59 61 60 /** … … 76 75 initMessages = true; 77 76 tokenGenerator = new EventGenerator(); 78 actionSequence = new LinkedList< WindowsEvent>();77 actionSequence = new LinkedList<Event>(); 79 78 prevMsg = 0; 80 79 } … … 91 90 if (startOfSequence(msg)) { 92 91 if (!initMessages) { 93 WindowsEvent currentAction = tokenGenerator92 Event currentAction = tokenGenerator 94 93 .generateEvent(currentSequence); 95 94 if (currentAction != null) { … … 129 128 * @return generated event sequence 130 129 */ 131 public List< WindowsEvent> getSequence() {130 public List<Event> getSequence() { 132 131 return actionSequence; 133 132 } … … 140 139 */ 141 140 public void endSession() { 142 WindowsEvent currentAction = tokenGenerator141 Event currentAction = tokenGenerator 143 142 .generateEvent(currentSequence); 144 143 if (currentAction != null) { -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/plugin/mfc/commands/CMDparseXML.java
r434 r566 7 7 8 8 import de.ugoe.cs.quest.CommandHelpers; 9 import de.ugoe.cs.quest.eventcore.Event; 9 10 import de.ugoe.cs.quest.plugin.mfc.MFCLogParser; 10 11 import de.ugoe.cs.quest.plugin.mfc.eventcore.MFCTargetComparator; 11 12 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowTree; 12 import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowsEvent;13 13 import de.ugoe.cs.quest.ui.GlobalDataContainer; 14 14 import de.ugoe.cs.util.console.Command; … … 63 63 parser.parseFile(filename); 64 64 65 Collection<List< WindowsEvent>> sequences = parser.getSequences();65 Collection<List<Event>> sequences = parser.getSequences(); 66 66 67 67 Console.traceln("Pre-computing event target equalities."); 68 68 // compare all Events to a dummy event to make sure they are known by 69 69 // the MFCTargetComparator 70 WindowsEvent dummyEvent = new WindowsEvent("dummy");71 for (List< WindowsEvent> sequence : sequences) {72 for ( WindowsEvent event : sequence) {70 Event dummyEvent = Event.STARTEVENT; 71 for (List<Event> sequence : sequences) { 72 for (Event event : sequence) { 73 73 event.equals(dummyEvent); 74 74 } -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/plugin/mfc/eventcore/WindowsEvent.java
r434 r566 10 10 import org.w3c.dom.NodeList; 11 11 12 import de.ugoe.cs.quest.eventcore.ReplayableEvent; 12 import de.ugoe.cs.quest.eventcore.Event; 13 13 14 14 15 /** … … 19 20 * @author Steffen Herbold 20 21 * @version 1.0 22 * @deprecated This class is deprecated and only kept for now for documentation - some features still need to be extracted and reconstructed elsewhere 21 23 */ 22 public class WindowsEvent extends ReplayableEvent<WindowsMessage>{24 public class WindowsEvent extends Event { 23 25 24 26 /** … … 39 41 */ 40 42 public WindowsEvent(String type) { 41 super( type);43 super(new MFCEventType("foo")); 42 44 } 43 45 44 @Override46 //@Override 45 47 protected boolean targetEquals(String otherTarget) { 46 return MFCTargetComparator.compare(target , otherTarget);48 return MFCTargetComparator.compare(target.toString(), otherTarget); 47 49 } 48 50 49 51 int targetHash = 0; 50 52 51 @Override53 //@Override 52 54 protected int targetHashCode() { 53 55 if( targetHash==0 ) { -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/plugin/mfc/eventcore/WindowsMessage.java
r434 r566 5 5 import java.util.Map; 6 6 7 import de.ugoe.cs.quest.IReplayDecorator; 7 8 import de.ugoe.cs.quest.eventcore.IReplayable; 9 import de.ugoe.cs.quest.plugin.mfc.MFCReplayDecorator; 8 10 import de.ugoe.cs.util.StringTools; 9 11 … … 509 511 } 510 512 511 /* 512 * (non-Javadoc) 513 * 514 * @see de.ugoe.cs.quest.eventcore.IReplayable#getTarget() 515 */ 516 @Override 517 public String getTarget() { 518 return xmlWindowDescription; 519 } 513 /* (non-Javadoc) 514 * @see de.ugoe.cs.quest.eventcore.IReplayable#getDecorator() 515 */ 516 @Override 517 public IReplayDecorator getDecorator() { 518 return MFCReplayDecorator.getInstance(); 519 } 520 520 }
Note: See TracChangeset
for help on using the changeset viewer.