source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/data/WebEvent.java @ 91

Last change on this file since 91 was 87, checked in by sherbold, 14 years ago
  • made event implementations serializable

+ added commands saveObject and loadObject to save data stored in the global data container

  • Property svn:mime-type set to text/plain
File size: 842 bytes
Line 
1package de.ugoe.cs.eventbench.web.data;
2
3import java.util.List;
4
5import de.ugoe.cs.eventbench.data.ReplayableEvent;
6
7public class WebEvent extends ReplayableEvent<WebRequest> {
8
9        /**
10         * Id for object serialization.
11         */
12        private static final long serialVersionUID = 1L;
13       
14        private final long timestamp;
15        private String uri;
16       
17        private final static String makeType(String uri, List<String> postVars) {
18                String type = uri;
19                if( postVars!=null && !postVars.isEmpty() ) {
20                        type += postVars.toString().replace(" ", "");
21                }
22                return type;
23        }
24       
25        public WebEvent(String uri, long timestamp, List<String> postVars) {
26                super(makeType(uri, postVars));
27                this.timestamp = timestamp;
28                this.uri = uri;
29                addReplayEvent(new WebRequest(uri, postVars));
30        }
31       
32        public long getTimestamp() {
33                return timestamp;
34        }
35
36}
Note: See TracBrowser for help on using the repository browser.