JAL-3878 Provide javadoc for WebServiceClientI interface
[jalview.git] / src / jalview / ws2 / actions / api / TaskI.java
1 package jalview.ws2.actions.api;
2
3 import java.util.List;
4
5 import jalview.viewmodel.AlignmentViewport;
6 import jalview.ws2.api.JobStatus;
7 import jalview.ws2.api.WebServiceJob;
8
9 /**
10  * {@code TaskI} objects represent running services. Tasks are created by
11  * concrete implementations of {@link ActionI} and provide a view of the state
12  * of the underlying job(s).
13  * 
14  * @author mmwarowny
15  *
16  * @param <T>
17  *          task result type
18  */
19 public interface TaskI<T>
20 {
21   /**
22    * Get the current status of the task. The resultant status should be
23    * a combination of individual sub-job statuses. 
24    * 
25    * @return global status of 
26    */
27   JobStatus getStatus();
28
29   /**
30    * Get the current list of sub-jobs of that task.
31    *  
32    * @return sub-jobs
33    */
34   List<? extends WebServiceJob> getSubJobs();
35
36   /**
37    * Get the last result of the task or {@code null} if not present.
38    * Note that the result is subject to change for restartable tasks.
39    * 
40    * @return last task result
41    */
42   T getResult();
43 }