Change header template for a new version
[jabaws.git] / webservices / compbio / data / msa / JManagement.java
1 /* Copyright (c) 2011 Peter Troshin\r
2  *  \r
3  *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0     \r
4  * \r
5  *  This library is free software; you can redistribute it and/or modify it under the terms of the\r
6  *  Apache License version 2 as published by the Apache Software Foundation\r
7  * \r
8  *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
9  *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
10  *  License for more details.\r
11  * \r
12  *  A copy of the license is in apache_license.txt. It is also available here:\r
13  * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
14  * \r
15  * Any republication or derived work distributed in source code form\r
16  * must include this copyright and license notice.\r
17  */\r
18 package compbio.data.msa;\r
19 \r
20 import java.security.InvalidParameterException;\r
21 \r
22 import javax.jws.WebParam;\r
23 \r
24 import compbio.metadata.ChunkHolder;\r
25 import compbio.metadata.JobStatus;\r
26 \r
27 public interface JManagement {\r
28 \r
29         /**\r
30          * Stop running the job <code>jobId</code> but leave its output untouched\r
31          * \r
32          * @return true if job was cancelled successfully, false otherwise\r
33          * @throws InvalidParameterException\r
34          *             is thrown if jobId is empty or cannot be recognised e.g. in\r
35          *             invalid format\r
36          */\r
37         boolean cancelJob(@WebParam(name = "jobId") String jobId);\r
38 \r
39         /**\r
40          * Return the status of the job.\r
41          * \r
42          * @param jobId\r
43          *            - unique job identifier\r
44          * @return JobStatus - status of the job\r
45          * @throws InvalidParameterException\r
46          *             is thrown if jobId is empty or cannot be recognised e.g. in\r
47          *             invalid format\r
48          * @see JobStatus\r
49          */\r
50         JobStatus getJobStatus(@WebParam(name = "jobId") String jobId);\r
51 \r
52         /**\r
53          * Reads 1kb chunk from the statistics file which is specific to a given web\r
54          * service from the <code>position</code>. If in time of a request less then\r
55          * 1kb data is available from the position to the end of the file, then it\r
56          * returns all the data available from the position to the end of the file.\r
57          * \r
58          * @param jobId\r
59          *            - unique job identifier\r
60          * @param position\r
61          *            - next position within the file to read\r
62          * @return ChunkHolder - which contains a chunk of data and a next position\r
63          *         within the file from which no data has been read\r
64          * @throws InvalidParameterException\r
65          *             thrown if jobId is empty or cannot be recognised e.g. in\r
66          *             invalid format and also if the position value is negative\r
67          * @see ChunkHolder\r
68          */\r
69         ChunkHolder pullExecStatistics(@WebParam(name = "jobId") String jobId,\r
70                         @WebParam(name = "position") long position);\r
71 \r
72 }\r