KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workflow > CmsTaskLog


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workflow/CmsTaskLog.java,v $
3  * Date : $Date: 2005/06/27 23:22:20 $
4  * Version: $Revision: 1.16 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workflow;
33
34 import org.opencms.db.CmsDbUtil;
35 import org.opencms.util.CmsUUID;
36
37 /**
38  * Describes an OpenCms task log entry.
39  *
40  * @author Alexander Kandzior
41  *
42  * @version $Revision: 1.16 $
43  *
44  * @since 6.0.0
45  */

46 public class CmsTaskLog {
47
48     /** The comment for this task log. */
49     private String JavaDoc m_comment;
50
51     /** The id of the task log. */
52     private int m_id = CmsDbUtil.UNKNOWN_ID;
53
54     /** The start time for this task log. */
55     private java.sql.Timestamp JavaDoc m_startTime;
56
57     /** The type for this task log, 0=SystemLog, 1=UserLog. */
58     private int m_type;
59
60     /** The id of the corresponding user. */
61     private CmsUUID m_userId;
62
63     /**
64      * Creates a new CmsTaskLog object.<p>
65      *
66      * @param id the id of the task log
67      * @param comment the comment for this task log
68      * @param userId the id Of the corresponding user
69      * @param starttime the start time for this task log
70      * @param type the type for this task log
71      */

72     public CmsTaskLog(int id, String JavaDoc comment, CmsUUID userId, java.sql.Timestamp JavaDoc starttime, int type) {
73
74         m_id = id;
75         m_comment = comment;
76         m_userId = userId;
77         m_startTime = starttime;
78         m_type = type;
79     }
80
81     /**
82      * @see java.lang.Object#equals(java.lang.Object)
83      */

84     public boolean equals(Object JavaDoc obj) {
85
86         if (obj == this) {
87             return true;
88         }
89         if (obj instanceof CmsTaskLog) {
90             return ((CmsTaskLog)obj).m_id == m_id;
91         }
92         return false;
93     }
94
95     /**
96      * Returns the comment of this task log entry.<p>
97      *
98      * @return the comment of this task log entry
99      */

100     public String JavaDoc getComment() {
101
102         return m_comment;
103     }
104
105     /**
106      * Returns the id of this task log entry.<p>
107      *
108      * @return the id of this task log entry
109      */

110     public int getId() {
111
112         return m_id;
113     }
114
115     /**
116      * Returns the start time of this task log entry.<p>
117      *
118      * @return the start time of this task log entry
119      */

120     public java.sql.Timestamp JavaDoc getStartTime() {
121
122         return m_startTime;
123     }
124
125     /**
126      * Returns the type of this task log entry.<p>
127      *
128      * @return the type of this task log entry
129      */

130     public int getType() {
131
132         return m_type;
133     }
134
135     /**
136      * Returns the user id of this task log entry.<p>
137      *
138      * @return the user id of this task log entry
139      */

140     public CmsUUID getUser() {
141
142         return m_userId;
143     }
144
145     /**
146      * @see java.lang.Object#hashCode()
147      */

148     public int hashCode() {
149
150         return (new Integer JavaDoc(m_id)).hashCode();
151     }
152
153     /**
154      * Sets the comment of this task log entry.<p>
155      *
156      * @param value the comment to set
157      */

158     public void setComment(String JavaDoc value) {
159
160         m_comment = value;
161     }
162
163     /**
164      * @see java.lang.Object#toString()
165      */

166     public String JavaDoc toString() {
167
168         StringBuffer JavaDoc result = new StringBuffer JavaDoc();
169         result.append("[TaskLog]");
170         result.append(" id:");
171         result.append(getId());
172         result.append(" comment:");
173         result.append(getComment());
174         result.append(" starttime:");
175         result.append(getStartTime());
176         result.append(" user:");
177         result.append(getUser());
178         if (getType() == CmsTaskService.TASKLOG_SYSTEM) {
179             result.append(" type:system");
180         } else {
181             result.append(" type:user");
182         }
183         return result.toString();
184     }
185 }
186
Popular Tags