View Javadoc

1   /*
2    * $Id: TaskStatus.java,v 1.1 2006/06/16 14:50:06 kea Exp $
3    *
4    * (C) Copyright Astrogrid...
5    */
6   
7   package org.astrogrid.status;
8   
9   import java.security.Principal;
10  import java.util.Date;
11  
12  /***
13   * Defines the things that a task status must be able to return
14   */
15  
16  public interface TaskStatus
17  {
18     public final static String INITIALISED = "Initialised";
19     public final static String QUEUED = "Queued";
20     public final static String RUNNING = "Running";
21     public final static String COMPLETE = "Complete";
22     public final static String ERROR = "Error";
23     public final static String ABORTED = "Aborted";
24  
25     /*** Returns the ID of the task, that might be used to act on the task */
26     public String getId();
27  
28     /*** Returns the time this status was reached */
29     public Date getTimestamp();
30     
31     /*** Returns who owns the task */
32     public Principal getOwner();
33     
34     /*** Returns one of the above stage constants */
35     public String getStage();
36     
37     /*** Returns some indication of the source of the task - undefined, but might
38      * be a URI or the interface used, etc */
39     public String getSource();
40     
41     /*** Returns true if the task has finished, whether it has completed successfully or not */
42     public boolean isFinished();
43     
44     /*** Some kind of progress indication.  */
45     public long getProgress();
46     public long getProgressMax();
47     /*** to go with progress indicators - eg 'getting row ' */
48     public String getProgressText();
49  
50     /*** A user description of the state of the current task */
51     public String getMessage();
52  
53     /*** A list of messages or some kind of history of the task.  For example, for datacenters
54      * this records what SQL was submitted, where the results are going to, etc that are concatinated
55      * as they occur
56      */
57     public String[] getDetails();
58     
59     /*** An implementation might use a 'chain' of statuses to record the history of
60      * the task.  To get the previous status use this */
61     public TaskStatus getPrevious();
62     
63     /*** Implement a convenience routine to get to the first task */
64     public TaskStatus getFirst();
65     
66  }
67  
68  /*
69  $Log: TaskStatus.java,v $
70  Revision 1.1  2006/06/16 14:50:06  kea
71  Moving code from astrogrid/status project back into pal, and updating
72  dependencies.
73  
74  Revision 1.1.1.1  2005/02/16 19:43:25  mch
75  Initial checkin
76  
77  Revision 1.1.1.1  2005/02/16 15:15:01  mch
78  Initial checkin
79  
80  Revision 1.1.26.3  2004/11/26 18:17:21  mch
81  More status persisting, browsing and aborting
82  
83  Revision 1.1.26.2  2004/11/25 18:33:43  mch
84  more status (incl persisting) more tablewriting lots of fixes
85  
86  Revision 1.1.26.1  2004/11/22 00:57:16  mch
87  New interfaces for SIAP etc and new slinger package
88  
89  Revision 1.1  2004/10/08 15:14:59  mch
90  Moved from server to client
91  
92  Revision 1.2  2004/10/05 15:04:00  mch
93  Added Queued
94  
95  Revision 1.1  2004/10/01 18:04:59  mch
96  Some factoring out of status stuff, added monitor page
97  
98  Revision 1.1  2004/10/01 09:42:56  mch
99  Began to factor out Status
100 
101 
102  */