1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.jes.job;
12
13
14 import org.astrogrid.community.beans.v1.Account;
15 import org.astrogrid.workflow.beans.v1.Workflow;
16 import org.astrogrid.workflow.beans.v1.execution.JobURN;
17
18 import java.util.Iterator;
19 /*** Interface to a creation / persistence component for jobs.
20 * @author Noel Winstanley nw@jb.man.ac.uk 09-Feb-2004
21 *
22 */
23 public interface JobFactory {
24 /*** start a transaction.
25 * @deprecated - not needed, and poorly supported. code in a way as not to require rollback instead
26 *
27 */
28 void begin();
29 /*** end a transaction
30 *
31 * @param bCommit whether to rollback or not.
32 * @return dunno
33 * @throws JobException
34 * @deprecated - not needed. poorly supported. don't rely on rollback functionality being there.
35 */
36 boolean end(boolean bCommit) throws JobException;
37 /*** initialize a newly-received workflow document
38 * - registers with store, assigns unique id, etc.
39 * @param req origiinal document
40 * @return initialized document (may be same objeect as req, may be copy)
41 * @throws JobException
42 */
43 Workflow initializeJob(Workflow req) throws JobException;
44 /*** retreive a job by unque id
45 *
46 * @param urn unique identifier for the job
47 * @return associated workflow object
48 * @throws JobException on general error
49 * @throws NotFoundException if the workflow associated with the unique id cannot be found.
50 * @throws DuplicateFoundException if the unique id has more than one workflow associated with it (unlikely, at least for current implementations)
51 */
52 Workflow findJob(JobURN urn) throws JobException, NotFoundException, DuplicateFoundException;
53
54 /*** return list of jobs for a user
55 * @todo change to a strongly-typed return type - Workflow[] for example.
56 * @param acc defines the user to search for jobs for
57 * @return iterator of <tt>Workflow</tt> objects: never null, may be empty
58 * @throws JobException
59 */
60 public Iterator findUserJobs(Account acc) throws JobException;
61 /*** remove a workflow document from the store
62 * @todo change to accepting jobURN instead
63 * @param job document to remove
64 * @throws JobException
65 */
66 void deleteJob(Workflow job) throws JobException;
67 /*** write an updated workflow document back to the store
68 *
69 * @param job - workflow document, containing the unique JobURN.
70 * @throws JobException
71 */
72 void updateJob(Workflow job) throws JobException;
73 }
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114