Ignore:
Timestamp:
03/18/15 09:58:50 (9 years ago)
Author:
sherbold
Message:
  • SimpleSOAPEvent now contains body of the SOAP request
  • SOAPUtils created
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/HTTPUtils.java

    r1923 r1924  
    1515package de.ugoe.cs.autoquest.plugin.http; 
    1616 
    17 import java.util.Iterator; 
    18 import java.util.LinkedList; 
    19 import java.util.List; 
    20  
    21 import de.ugoe.cs.autoquest.eventcore.Event; 
    22 import de.ugoe.cs.autoquest.plugin.http.eventcore.SOAPEventType; 
    23 import de.ugoe.cs.autoquest.plugin.http.eventcore.SimpleSOAPEventType; 
    2417import de.ugoe.cs.autoquest.plugin.http.logdata.Address; 
    2518 
     
    128121    /** 
    129122     * <p> 
    130      * Replaces events with a {@link SOAPEventType} with new events of {@link SimpleSOAPEventType} 
    131      * and no target. 
    132      * </p> 
    133      *  
    134      * @param sequence 
    135      *            sequence where the events are replaced 
    136      * @param keepOnlySOAPEvents 
    137      *            if true, all events that are not of SOAPEventType or SimpleSOAPEventType are 
    138      *            removed 
    139      * @return sequence with {@link SimpleSOAPEventType}s instead of {@link SOAPEventType}s 
    140      */ 
    141     public static List<Event> convertToSimpleSOAPEvent(List<Event> sequence, 
    142                                                        boolean keepOnlySOAPEvents) 
    143     { 
    144         List<Event> newSequence = null; 
    145         if (sequence != null) { 
    146             newSequence = new LinkedList<>(); 
    147             for (Event event : sequence) { 
    148                 if (event.getType() instanceof SOAPEventType) { 
    149                     SOAPEventType eventType = (SOAPEventType) event.getType(); 
    150                     newSequence.add(new Event(new SimpleSOAPEventType(eventType.getCalledMethod(), 
    151                                                                       eventType.getServiceName(), 
    152                                                                       eventType.getClientName()))); 
    153                 } 
    154                 else { 
    155                     if (!keepOnlySOAPEvents || event.getType() instanceof SimpleSOAPEventType) { 
    156                         newSequence.add(event); 
    157                     } 
    158                 } 
    159             } 
    160         } 
    161         return newSequence; 
    162     } 
    163      
    164     /** 
    165      * <p> 
    166      * Removes all non SOAP events from a sequence. Warning: this change is performed in-place! 
    167      * </p> 
    168      *  
    169      * @param sequence 
    170      *            sequence where the events are replaced 
    171      */ 
    172     public static void removeNonSOAPEvents(List<Event> sequence) 
    173     { 
    174         for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) { 
    175             Event event = eventIter.next(); 
    176             if (!(event.getType() instanceof SOAPEventType)) { 
    177                 eventIter.remove(); 
    178             } 
    179         } 
    180     } 
    181  
    182     /** 
    183      * <p> 
    184123     * prevent instantiation 
    185124     * </p> 
Note: See TracChangeset for help on using the changeset viewer.