8232260d0dae5f9ca88a652f707ef36ada9ca649
[jabaws.git] / webservices / compbio / data / msa / JManagement.java
1 package compbio.data.msa;\r
2 \r
3 import java.security.InvalidParameterException;\r
4 \r
5 import javax.jws.WebParam;\r
6 \r
7 import compbio.metadata.ChunkHolder;\r
8 import compbio.metadata.JobStatus;\r
9 \r
10 public interface JManagement {\r
11 \r
12         /**\r
13          * Stop running the job <code>jobId</code> but leave its output untouched\r
14          * \r
15          * @return true if job was cancelled successfully, false otherwise\r
16          * @throws InvalidParameterException\r
17          *             is thrown if jobId is empty or cannot be recognised e.g. in\r
18          *             invalid format\r
19          */\r
20         boolean cancelJob(@WebParam(name = "jobId") String jobId);\r
21 \r
22         /**\r
23          * Return the status of the job.\r
24          * \r
25          * @param jobId\r
26          *            - unique job identifier\r
27          * @return JobStatus - status of the job\r
28          * @throws InvalidParameterException\r
29          *             is thrown if jobId is empty or cannot be recognised e.g. in\r
30          *             invalid format\r
31          * @see JobStatus\r
32          */\r
33         JobStatus getJobStatus(@WebParam(name = "jobId") String jobId);\r
34 \r
35         /**\r
36          * Reads 1kb chunk from the statistics file which is specific to a given web\r
37          * service from the <code>position</code>. If in time of a request less then\r
38          * 1kb data is available from the position to the end of the file, then it\r
39          * returns all the data available from the position to the end of the file.\r
40          * \r
41          * @param jobId\r
42          *            - unique job identifier\r
43          * @param position\r
44          *            - next position within the file to read\r
45          * @return ChunkHolder - which contains a chunk of data and a next position\r
46          *         within the file from which no data has been read\r
47          * @throws InvalidParameterException\r
48          *             thrown if jobId is empty or cannot be recognised e.g. in\r
49          *             invalid format and also if the position value is negative\r
50          * @see ChunkHolder\r
51          */\r
52         ChunkHolder pullExecStatistics(@WebParam(name = "jobId") String jobId,\r
53                         @WebParam(name = "position") long position);\r
54 \r
55 }\r