1 19 20 package org.efs.openreports.objects; 21 22 import java.io.Serializable ; 23 import java.util.Date ; 24 25 public class ReportLog implements Serializable  26 { 27 private static final long serialVersionUID = -7260204621599035553L; 28 29 public static final String STATUS_SUCCESS = "success"; 30 public static final String STATUS_FAILURE = "failure"; 31 public static final String STATUS_EMPTY = "empty"; 32 public static final String STATUS_TRIGGERED = "triggered"; 33 public static final String STATUS_NOT_TRIGGERED = "not triggered"; 34 35 private Integer id; 36 private Report report; 37 private Date startTime; 38 private Date endTime; 39 private String status; 40 private String message; 41 private ReportUser user; 42 private ReportAlert alert; 43 44 public ReportLog() 45 { 46 } 47 48 public ReportLog(ReportUser user, Report report, Date startTime) 49 { 50 this.user = user; 51 this.report = report; 52 this.startTime = startTime; 53 } 54 55 public ReportLog(ReportUser user, ReportAlert alert, Date startTime) 56 { 57 this.user = user; 58 this.alert = alert; 59 this.startTime = startTime; 60 } 61 62 public Integer getId() 63 { 64 return id; 65 } 66 67 public void setId(Integer id) 68 { 69 this.id = id; 70 } 71 72 public String getMessage() 73 { 74 return message; 75 } 76 77 public void setMessage(String message) 78 { 79 this.message = message; 80 } 81 82 public Report getReport() 83 { 84 return report; 85 } 86 87 public void setReport(Report report) 88 { 89 this.report = report; 90 } 91 92 public Date getStartTime() 93 { 94 return startTime; 95 } 96 97 public void setStartTime(Date startTime) 98 { 99 this.startTime = startTime; 100 } 101 102 public String getStatus() 103 { 104 return status; 105 } 106 107 public void setStatus(String status) 108 { 109 this.status = status; 110 } 111 112 public Date getEndTime() 113 { 114 return endTime; 115 } 116 117 public void setEndTime(Date endTime) 118 { 119 this.endTime = endTime; 120 } 121 122 public long getElapsedTime() 123 { 124 if (endTime != null && startTime != null) 125 { 126 long elapsedTime = endTime.getTime() - startTime.getTime(); 127 return elapsedTime / 1000; 128 } 129 else 130 { 131 return 0; 132 } 133 134 135 } 136 137 public ReportUser getUser() 138 { 139 return user; 140 } 141 142 public void setUser(ReportUser user) 143 { 144 this.user = user; 145 } 146 147 public ReportAlert getAlert() 148 { 149 return alert; 150 } 151 152 public void setAlert(ReportAlert alert) 153 { 154 this.alert = alert; 155 } 156 157 }
| Popular Tags
|