KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > efs > openreports > objects > ReportLog


1 /*
2  * Copyright (C) 2003 Erik Swenson - eswenson@opensourcesoft.net
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; either version 2 of the License, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16  * Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */

19
20 package org.efs.openreports.objects;
21
22 import java.io.Serializable JavaDoc;
23 import java.util.Date JavaDoc;
24
25 public class ReportLog implements Serializable JavaDoc
26 {
27     private static final long serialVersionUID = -7260204621599035553L;
28     
29     public static final String JavaDoc STATUS_SUCCESS = "success";
30     public static final String JavaDoc STATUS_FAILURE = "failure";
31     public static final String JavaDoc STATUS_EMPTY = "empty";
32     public static final String JavaDoc STATUS_TRIGGERED = "triggered";
33     public static final String JavaDoc STATUS_NOT_TRIGGERED = "not triggered";
34     
35     private Integer JavaDoc id;
36     private Report report;
37     private Date JavaDoc startTime;
38     private Date JavaDoc endTime;
39     private String JavaDoc status;
40     private String JavaDoc message;
41     private ReportUser user;
42     private ReportAlert alert;
43
44     public ReportLog()
45     {
46     }
47
48     public ReportLog(ReportUser user, Report report, Date JavaDoc startTime)
49     {
50         this.user = user;
51         this.report = report;
52         this.startTime = startTime;
53     }
54     
55     public ReportLog(ReportUser user, ReportAlert alert, Date JavaDoc startTime)
56     {
57         this.user = user;
58         this.alert = alert;
59         this.startTime = startTime;
60     }
61     
62     public Integer JavaDoc getId()
63     {
64         return id;
65     }
66
67     public void setId(Integer JavaDoc id)
68     {
69         this.id = id;
70     }
71
72     public String JavaDoc getMessage()
73     {
74         return message;
75     }
76
77     public void setMessage(String JavaDoc 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 JavaDoc getStartTime()
93     {
94         return startTime;
95     }
96
97     public void setStartTime(Date JavaDoc startTime)
98     {
99         this.startTime = startTime;
100     }
101
102     public String JavaDoc getStatus()
103     {
104         return status;
105     }
106
107     public void setStatus(String JavaDoc status)
108     {
109         this.status = status;
110     }
111
112     public Date JavaDoc getEndTime()
113     {
114         return endTime;
115     }
116
117     public void setEndTime(Date JavaDoc 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