Source Code Cross Referenced for JobStateEntry.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » vdl » workflow » 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 » pegasus 2.1.0 » org.griphyn.vdl.workflow 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found in file GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:        package org.griphyn.vdl.workflow;
016:
017:        import java.util.*;
018:        import org.griphyn.common.util.Currently;
019:
020:        /**
021:         * This class is the container for a job state record.<p>
022:         *
023:         * When constructing a job from piece-meal, please note that setting the
024:         * job's state will automatically set the job's last modification time
025:         * to the current time. If this is not desired, you must set the
026:         * modification time after setting the state. However, none of the
027:         * constructors will set the modification to the current time (yet). 
028:         *
029:         * @author Jens-S. Vöckler
030:         * @author Mike Wilde
031:         * @version $Revision: 50 $
032:         */
033:        public class JobStateEntry implements  Workflow, Cloneable {
034:            /**
035:             * primary key: which workflow do we belong to. If -1 then unknown.
036:             */
037:            private long m_wfid = -1;
038:
039:            /**
040:             * primary key: unique job identifier within the workflow
041:             */
042:            private String m_id;
043:
044:            /**
045:             * the Condor state of the job.
046:             */
047:            private String m_state;
048:
049:            /**
050:             * the last modification time of the job state.
051:             */
052:            private Date m_mtime;
053:
054:            /**
055:             * the resource where the job ran, may be unspecified.
056:             */
057:            private String m_site = null;
058:
059:            /**
060:             * Creates and returns a copy of this object.
061:             * @return a new instance.
062:             */
063:            public Object clone() {
064:                JobStateEntry result = new JobStateEntry(getWorkflowID(),
065:                        getID());
066:                result.setState(getState());
067:                result.setModificationTime(getModificationTime());
068:                result.setSite(getSite());
069:                return result;
070:            }
071:
072:            /**
073:             * Default contructor.
074:             */
075:            public JobStateEntry() {
076:                // empty
077:            }
078:
079:            /**
080:             * Constructs an other empty class.
081:             *
082:             * @param wfid is the workflow primary key 
083:             */
084:            public JobStateEntry(long wfid) {
085:                m_wfid = wfid;
086:            }
087:
088:            /**
089:             * Constructs an other empty class.
090:             *
091:             * @param wfid is the workflow primary key 
092:             * @param jobid is the job identifier within the workflow
093:             */
094:            public JobStateEntry(long wfid, String jobid) {
095:                m_wfid = wfid;
096:                m_id = jobid;
097:            }
098:
099:            /**
100:             * Constructs an other empty class. It will set the workflow identifier
101:             * to -1 to indicate no connection.
102:             *
103:             * @param jobid is the job identifier within the workflow
104:             */
105:            public JobStateEntry(String jobid) {
106:                m_wfid = -1;
107:                m_id = jobid;
108:            }
109:
110:            /**
111:             * Accessor
112:             *
113:             * @see #setWorkflowID(long)
114:             * @return this job's workflow identifier.
115:             */
116:            public long getWorkflowID() {
117:                return this .m_wfid;
118:            }
119:
120:            /**
121:             * Accessor.
122:             *
123:             * @param wfid is the new workflow id as positive number.
124:             * @see #getWorkflowID()
125:             */
126:            public void setWorkflowID(long wfid) {
127:                if (wfid < 0)
128:                    throw new RuntimeException("negative workflow id");
129:                this .m_wfid = wfid;
130:            }
131:
132:            /**
133:             * Accessor
134:             *
135:             * @see #setID(String)
136:             * @return the job identifier
137:             */
138:            public String getID() {
139:                return this .m_id;
140:            }
141:
142:            /**
143:             * Accessor.
144:             *
145:             * @param id is the new job id, must not be <code>null</code>.
146:             * @see #getID()
147:             */
148:            public void setID(String id) {
149:                if (id == null)
150:                    throw new NullPointerException();
151:                this .m_id = id;
152:            }
153:
154:            /**
155:             * Accessor
156:             *
157:             * @see #setState(String)
158:             * @return the Condor job state string with some extensions. 
159:             */
160:            public String getState() {
161:                return this .m_state;
162:            }
163:
164:            /**
165:             * Accessor. As a side effect, setting the job state will
166:             * set the current modification time to the current time. 
167:             *
168:             * @param state is the new Condor job state, must not be
169:             * <code>null</code>.
170:             * @see #getState()
171:             */
172:            public void setState(String state) {
173:                if (state == null)
174:                    throw new NullPointerException();
175:                this .m_state = state;
176:                this .m_mtime = new Date();
177:            }
178:
179:            /**
180:             * Accessor
181:             *
182:             * @see #setModificationTime(Date)
183:             * @return the last modification time of any of this job's state. 
184:             */
185:            public Date getModificationTime() {
186:                return this .m_mtime;
187:            }
188:
189:            /**
190:             * Accessor.
191:             *
192:             * @param mtime is the new last modification time of this job, must
193:             * not be <code>null</code>.
194:             * @see #getModificationTime()
195:             */
196:            public void setModificationTime(Date mtime) {
197:                if (mtime == null)
198:                    throw new NullPointerException();
199:                this .m_mtime = mtime;
200:            }
201:
202:            /**
203:             * Accessor
204:             *
205:             * @see #setSite(String)
206:             */
207:            public String getSite() {
208:                return this .m_site;
209:            }
210:
211:            /**
212:             * Accessor.
213:             *
214:             * @param site is the new remote site, may be <code>null</code>.
215:             * @see #getSite()
216:             */
217:            public void setSite(String site) {
218:                this .m_site = site;
219:            }
220:
221:            /**
222:             * Constructs a simple line of all internal data points. Adjust
223:             * to your requirements - this is an example, only.
224:             *
225:             * @return a line containing all internal data.
226:             */
227:            public String toString() {
228:                StringBuffer result = new StringBuffer(80);
229:
230:                result.append(Long.toString(m_wfid)).append('|');
231:                result.append(m_id).append('|');
232:                result.append(m_state).append('|');
233:                result.append(Currently.iso8601(false, true, false, m_mtime))
234:                        .append('|');
235:                result.append(m_site == null ? "NULL" : m_site);
236:
237:                return result.toString();
238:            }
239:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.