View Javadoc

1   /*$Id: JobFactory.java,v 1.12 2004/07/09 09:30:28 nw Exp $
2    * Created on 09-Feb-2004
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
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  $Log: JobFactory.java,v $
76  Revision 1.12  2004/07/09 09:30:28  nw
77  merged in scripting workflow interpreter from branch
78  nww-x-workflow-extensions
79  
80  Revision 1.11  2004/03/15 01:31:12  nw
81  jazzed up javadoc
82  
83  Revision 1.10  2004/03/04 01:57:35  nw
84  major refactor.
85  upgraded to latest workflow object model.
86  removed internal facade
87  replaced community snippet with objects
88  
89  Revision 1.9  2004/03/03 01:13:42  nw
90  updated jes to work with regenerated workflow object model
91  
92  Revision 1.8  2004/02/27 00:46:03  nw
93  merged branch nww-itn05-bz#91
94  
95  Revision 1.7.2.5  2004/02/19 13:34:23  nw
96  cut out useless classes,
97  moved constants into generated code.
98  
99  Revision 1.7.2.4  2004/02/17 12:25:38  nw
100 improved javadocs for classes
101 
102 Revision 1.7.2.3  2004/02/12 01:16:08  nw
103 analyzed code, stripped interfaces of all unused methods.
104 
105 Revision 1.7.2.2  2004/02/09 18:28:57  nw
106 remomved refernece to org.w3c.dom.Document in object interfaces.
107 
108 Revision 1.7.2.1  2004/02/09 12:39:06  nw
109 isolated existing datamodel.
110 refactored to extract interfaces from all current datamodel classes in org.astrogrid.jes.job.
111 moved implementation of interfaces to org.astrogrid.jes.impl
112 refactored so services reference interface rather than current implementation
113  
114 */