Source Code Cross Referenced for Work.java in  » Workflow-Engines » osbl-1_0 » org » concern » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » osbl 1_0 » org.concern 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: Work.java 661 2006-03-10 22:47:16Z hengels $
003:         * (c) Copyright 2004 con:cern development team.
004:         *
005:         * This file is part of con:cern (http://concern.sf.net).
006:         *
007:         * con:cern is free software; you can redistribute it and/or modify
008:         * it under the terms of the GNU Lesser General Public License
009:         * as published by the Free Software Foundation; either version 2.1
010:         * of the License, or (at your option) any later version.
011:         *
012:         * Please see COPYING for the complete licence.
013:         */
014:        package org.concern;
015:
016:        import java.sql.Timestamp;
017:        import java.util.*;
018:
019:        /**
020:         * Work describes a unit of concern. It referes to a process, an activity and a subject.
021:         */
022:        public class Work {
023:            protected String process;
024:            protected String activity;
025:            protected String subjectId;
026:            protected String subjectLine;
027:            protected int level;
028:            protected String originator;
029:            protected Timestamp due;
030:            protected String lockedBy;
031:            protected Timestamp lockedUntil;
032:
033:            private Object subject;
034:
035:            protected Work() {
036:            }
037:
038:            public Work(String process, String activity, String subjectId) {
039:                this .process = process;
040:                this .subjectId = subjectId;
041:                this .activity = activity;
042:            }
043:
044:            public Work(String process, String activity, String subjectId,
045:                    String subjectLine, String originator, Timestamp due,
046:                    int level, String lockedBy, Timestamp lockedUntil) {
047:                this .process = process;
048:                this .activity = activity;
049:                this .subjectId = subjectId;
050:                this .subjectLine = subjectLine;
051:                this .originator = originator;
052:                this .due = due;
053:                this .level = level;
054:                this .lockedBy = lockedBy;
055:                this .lockedUntil = lockedUntil;
056:            }
057:
058:            // hibernate bug .. won't locate the constructor with parameters of type timestamp
059:            public Work(String process, String activity, String subjectId,
060:                    String subjectLine, String originator, long due, int level,
061:                    String lockedBy, Date lockedUntil) {
062:                this .process = process;
063:                this .activity = activity;
064:                this .subjectId = subjectId;
065:                this .subjectLine = subjectLine;
066:                this .originator = originator;
067:                if (due != Long.MAX_VALUE)
068:                    this .due = new Timestamp(due);
069:                this .level = level;
070:                this .lockedBy = lockedBy;
071:                if (lockedUntil != null)
072:                    this .lockedUntil = new Timestamp(lockedUntil.getTime());
073:            }
074:
075:            /**
076:             * @return identifies the subject
077:             */
078:            public String getSubjectId() {
079:                return subjectId;
080:            }
081:
082:            /**
083:             * The name of the process to which the activity belongs.
084:             * @return the process name
085:             */
086:            public String getProcess() {
087:                return process;
088:            }
089:
090:            /**
091:             * The name of the activity that is to be executed.
092:             * @return
093:             */
094:            public String getActivity() {
095:                return activity;
096:            }
097:
098:            /**
099:             * The task is due until ..
100:             * @return
101:             */
102:            public Timestamp getDue() {
103:                return due;
104:            }
105:
106:            /**
107:             * The subject orginated from ..
108:             * @return
109:             */
110:            public String getOriginator() {
111:                return originator;
112:            }
113:
114:            /**
115:             * The localized subject line
116:             * @return
117:             */
118:            public String getSubjectLine() {
119:                return subjectLine;
120:            }
121:
122:            public int getLevel() {
123:                return level;
124:            }
125:
126:            public void setLevel(int level) {
127:                this .level = level;
128:            }
129:
130:            /**
131:             * Currently locked by ..
132:             * @return
133:             */
134:            public String getLockedBy() {
135:                return lockedBy;
136:            }
137:
138:            /**
139:             * Supposably locked until ..
140:             * @return
141:             */
142:            public Timestamp getLockedUntil() {
143:                return lockedUntil;
144:            }
145:
146:            /**
147:             * The subject itself as loaded by the Loader.
148:             * @return the subject
149:             */
150:            public Object getSubject() {
151:                return subject;
152:            }
153:
154:            /**
155:             * The subject itself as loaded by the Loader.
156:             * @param subject the subject
157:             */
158:            public void setSubject(Object subject) {
159:                this .subject = subject;
160:            }
161:
162:            public boolean isOptional() {
163:                return due == null;
164:            }
165:
166:            public boolean equals(Object o) {
167:                if (this  == o)
168:                    return true;
169:                if (!(o instanceof  Work))
170:                    return false;
171:
172:                final Work work = (Work) o;
173:
174:                if (!activity.equals(work.activity))
175:                    return false;
176:                if (!process.equals(work.process))
177:                    return false;
178:                if (!subjectId.equals(work.subjectId))
179:                    return false;
180:
181:                return true;
182:            }
183:
184:            public int hashCode() {
185:                int result;
186:                result = subjectId.hashCode();
187:                result = 29 * result + activity.hashCode();
188:                result = 29 * result + process.hashCode();
189:                return result;
190:            }
191:
192:            public String toString() {
193:                return process + ":" + activity + ":" + subjectId;
194:            }
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.