Adding AAConWS
[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 job but leave its output untouched\r
14          * \r
15          * @return true if job was cancelled successfully, false otherwise\r
16          * @throws InvalidParameterException\r
17          *             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. @see JobStatus\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          *             thrown if jobId is empty or cannot be recognised e.g. in\r
30          *             invalid format\r
31          */\r
32         JobStatus getJobStatus(@WebParam(name = "jobId") String jobId);\r
33 \r
34         /**\r
35          * Reads 1kb chunk from the statistics file which is specific to a given web\r
36          * service from the position. If in time of a request less then 1kb data is\r
37          * available from the position to the end of the file, then it returns all\r
38          * the data available from the position to the end of the file.\r
39          * \r
40          * @param jobId\r
41          *            - unique job identifier\r
42          * @param position\r
43          *            - next position within the file to read\r
44          * @return ChunkHolder - @see ChunkHolder which contains a chuink of data\r
45          *         and a next position within the file from which no data has been\r
46          *         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          */\r
51         ChunkHolder pullExecStatistics(@WebParam(name = "jobId") String jobId,\r
52                         @WebParam(name = "position") long position);\r
53 \r
54 }\r