- Timestamp:
- 07/07/11 11:04:27 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/data/WebEvent.java
r87 r111 8 8 9 9 /** 10 * <p> 10 11 * Id for object serialization. 12 * </p> 11 13 */ 12 14 private static final long serialVersionUID = 1L; 13 15 14 16 private final long timestamp; 15 private String uri;17 16 18 17 private final static String makeType(String uri, List<String> postVars) { 18 String type = uri; 19 private final static String makeType(String path, List<String> postVars, List<String> getVars) { 20 String type = path; 21 if( getVars!=null && !getVars.isEmpty() ) { 22 type += "+GET"+getVars.toString().replace(" ", ""); 23 } 19 24 if( postVars!=null && !postVars.isEmpty() ) { 20 type += postVars.toString().replace(" ", "");25 type += "+POST"+postVars.toString().replace(" ", ""); 21 26 } 22 27 return type; 23 28 } 24 29 25 public WebEvent(String uri, long timestamp, List<String> postVars) {26 super(makeType( uri, postVars));30 public WebEvent(String path, long timestamp, List<String> postVars, List<String> getVars) { 31 super(makeType(path, postVars, getVars)); 27 32 this.timestamp = timestamp; 28 this.uri = uri; 29 addReplayEvent(new WebRequest(uri, postVars)); 33 addReplayEvent(new WebRequest(path, postVars, getVars)); 30 34 } 31 35 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/data/WebRequest.java
r90 r111 14 14 15 15 List<String> postVars; 16 List<String> getVars; 16 17 17 18 String targetUri; 18 19 19 public WebRequest(String uri, List<String> postVars ) {20 public WebRequest(String uri, List<String> postVars, List<String> getVars) { 20 21 targetUri = uri; 21 22 this.postVars = new ArrayList<String>(postVars); // defensive copy 23 this.getVars = new ArrayList<String>(getVars); 22 24 } 23 25 … … 33 35 return null; 34 36 } 37 38 @Override 39 public boolean equals(Object other) { 40 if( this==other ) { 41 return true; 42 } 43 if( other instanceof WebRequest ) { 44 return targetUri.equals(((WebRequest) other).targetUri) && postVars.equals(((WebRequest) other).postVars); 45 } 46 return false; 47 } 48 49 @Override 50 public int hashCode() { 51 int multiplier = 17; 52 int hash = 42; 53 54 hash = multiplier * hash + targetUri.hashCode(); 55 hash = multiplier * hash + postVars.hashCode(); 56 57 return hash; 58 } 35 59 36 60 }
Note: See TracChangeset
for help on using the changeset viewer.