1 package dst.ass3.event.model.events;
3 import java.io.Serializable;
5 import dst.ass3.event.model.domain.IUploadEventInfo;
6 import dst.ass3.event.model.domain.RequestType;
7 import dst.ass3.event.model.domain.UploadState;
10 * Indicates a change in the lifecycle state of an IUploadEventInfo.
12 public class LifecycleEvent implements Serializable {
14 private static final long serialVersionUID = 8665269919851487210L;
17 * The id of the UploadRequest (the MOOC business concept), as returned by {@link IUploadEventInfo#getRequestId()}.
19 private long requestId;
21 private UploadState state;
22 private String server;
23 private RequestType requestType;
26 * The instant the event was recorded (unix epoch in milliseconds)
28 private long timestamp;
30 public LifecycleEvent() {
33 public LifecycleEvent(IUploadEventInfo eventInfo) {
34 this(eventInfo.getRequestId(), eventInfo.getState(), eventInfo.getServer(), eventInfo.getRequestType(), eventInfo.getTimestamp());
37 public LifecycleEvent(long requestId, UploadState state, String server, RequestType requestType, long timestamp) {
38 this.requestId = requestId;
41 this.requestType = requestType;
42 this.timestamp = timestamp;
45 public long getRequestId() {
49 public void setRequestId(long requestId) {
50 this.requestId = requestId;
53 public UploadState getState() {
57 public void setState(UploadState state) {
61 public String getServer() {
65 public void setServer(String server) {
69 public RequestType getRequestType() {
73 public void setRequestType(RequestType requestType) {
74 this.requestType = requestType;
77 public long getTimestamp() {
81 public void setTimestamp(long timestamp) {
82 this.timestamp = timestamp;
86 public String toString() {
87 return "LifecycleEvent{" +
88 "requestId=" + requestId +
90 ", server='" + server + '\'' +
91 ", requestType=" + requestType +
92 ", timestamp=" + timestamp +