- Timestamp:
- 09/09/11 06:23:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/data/WebEvent.java
r111 r171 5 5 import de.ugoe.cs.eventbench.data.ReplayableEvent; 6 6 7 /** 8 * <p> 9 * This class defines web events (of PHP-based web applications). 10 * </p> 11 * 12 * @author Steffen Herbold 13 * @version 1.0 14 * 15 */ 7 16 public class WebEvent extends ReplayableEvent<WebRequest> { 8 17 … … 13 22 */ 14 23 private static final long serialVersionUID = 1L; 15 24 25 /** 26 * Timestamp of the event. 27 */ 16 28 private final long timestamp; 17 18 19 private final static String makeType(String path, List<String> postVars, List<String> getVars) { 29 30 /** 31 * <p> 32 * Helper method that generates the type of the event based on the of the 33 * URI, the POST variables, and the GET variables. 34 * </p> 35 * 36 * @param path 37 * path of the URI of the event 38 * @param postVars 39 * POST variables send with the event 40 * @param getVars 41 * GET variables send with the event 42 * @return type of the event 43 */ 44 private final static String makeType(String path, List<String> postVars, 45 List<String> getVars) { 20 46 String type = path; 21 if ( getVars!=null && !getVars.isEmpty()) {22 type += "+GET" +getVars.toString().replace(" ", "");47 if (getVars != null && !getVars.isEmpty()) { 48 type += "+GET" + getVars.toString().replace(" ", ""); 23 49 } 24 if ( postVars!=null && !postVars.isEmpty()) {25 type += "+POST" +postVars.toString().replace(" ", "");50 if (postVars != null && !postVars.isEmpty()) { 51 type += "+POST" + postVars.toString().replace(" ", ""); 26 52 } 27 53 return type; 28 54 } 29 30 public WebEvent(String path, long timestamp, List<String> postVars, List<String> getVars) { 55 56 /** 57 * <p> 58 * Constructor. Creates a new WebEvent. 59 * </p> 60 * 61 * @param path 62 * path of the URI 63 * @param timestamp 64 * timestamp of when the event took place 65 * @param postVars 66 * POST variables send with the event 67 * @param getVars 68 * GET variables send with the event 69 */ 70 public WebEvent(String path, long timestamp, List<String> postVars, 71 List<String> getVars) { 31 72 super(makeType(path, postVars, getVars)); 32 73 this.timestamp = timestamp; 33 74 addReplayEvent(new WebRequest(path, postVars, getVars)); 34 75 } 35 76 77 /** 78 * <p> 79 * Returns the timestamp of the event. 80 * </p> 81 * 82 * @return timestamp of th event 83 */ 36 84 public long getTimestamp() { 37 85 return timestamp;
Note: See TracChangeset
for help on using the changeset viewer.