More javadocs
[jabaws.git] / webservices / compbio / data / msa / Annotation.java
1 package compbio.data.msa;\r
2 \r
3 import java.security.InvalidParameterException;\r
4 import java.util.HashSet;\r
5 import java.util.List;\r
6 \r
7 import javax.jws.WebMethod;\r
8 import javax.jws.WebParam;\r
9 import javax.jws.WebService;\r
10 \r
11 import compbio.data.sequence.FastaSequence;\r
12 import compbio.data.sequence.Score;\r
13 import compbio.metadata.JobSubmissionException;\r
14 import compbio.metadata.LimitExceededException;\r
15 import compbio.metadata.Option;\r
16 import compbio.metadata.Preset;\r
17 import compbio.metadata.ResultNotAvailableException;\r
18 import compbio.metadata.UnsupportedRuntimeException;\r
19 import compbio.metadata.WrongParameterException;\r
20 \r
21 /**\r
22  * Interface for tools that results to one or more annotation to sequence(s)\r
23  * \r
24  * @author Peter Troshin\r
25  * \r
26  * @param <T>\r
27  *            executable type / web service type\r
28  * \r
29  * @version 1.0 November 2010\r
30  */\r
31 @WebService(targetNamespace = "http://msa.data.compbio/01/12/2010/")\r
32 public interface Annotation<T> extends JABAService, JManagement, Metadata<T> {\r
33 \r
34         /**\r
35          * \r
36          * Analyse the sequences. The actual analysis algorithm is defined by the\r
37          * type T.\r
38          * \r
39          * Any dataset containing a greater number of sequences or the average\r
40          * length of the sequences are greater then defined in the default Limit\r
41          * will not be accepted for an alignment operation and\r
42          * JobSubmissionException will be thrown.\r
43          * \r
44          * @param sequences\r
45          *            List of FastaSequence objects. The programme does not perform\r
46          *            any sequence validity checks. Nor does it checks whether the\r
47          *            sequences names are unique. It is responsibility of the caller\r
48          *            to validate this information\r
49          * @return jobId - unique identifier for the job\r
50          * @throws JobSubmissionException\r
51          *             is thrown when the job could not be submitted due to the\r
52          *             following reasons: 1) The number of sequences in the\r
53          *             submission or their average length is greater then defined by\r
54          *             the default Limit. 2) Any problems on the server side e.g. it\r
55          *             is misconfigured or malfunction, is reported via this\r
56          *             exception. In the first case the information on the limit\r
57          *             could be obtained from an exception.\r
58          * @throws InvalidParameterException\r
59          *             thrown if input list of fasta sequence is null or empty\r
60          * @throws UnsupportedRuntimeException\r
61          *             thrown if server OS does not support native executables for a\r
62          *             given web service, e.g. JABAWS is deployed on Windows and\r
63          *             Mafft service is called\r
64          * @throws LimitExceededException\r
65          *             is throw if the input sequences number or average length\r
66          *             exceeds what is defined by the limit\r
67          */\r
68         @WebMethod\r
69         String analize(\r
70                         @WebParam(name = "fastaSequences") List<FastaSequence> sequences)\r
71                         throws UnsupportedRuntimeException, LimitExceededException,\r
72                         JobSubmissionException;\r
73 \r
74         /**\r
75          * Analyse the sequences according to custom settings defined in options\r
76          * list. The actual analysis algorithm is defined by the type T. Default\r
77          * Limit is used to decide whether the calculation will be permitted or\r
78          * denied\r
79          * \r
80          * @param sequences\r
81          *            List of FastaSequence objects. The programme does not perform\r
82          *            any sequence validity checks. Nor does it checks whether the\r
83          *            sequences names are unique. It is responsibility of the caller\r
84          *            to validate this information\r
85          * @param options\r
86          *            A list of Options\r
87          * @return jobId - unique identifier for the job\r
88          * @throws JobSubmissionException\r
89          *             is thrown when the job could not be submitted due to the\r
90          *             following reasons: 1) The number of sequences in the\r
91          *             submission or their average length is greater then defined by\r
92          *             the default Limit. 2) Any problems on the server side e.g. it\r
93          *             is misconfigured or malfunction, is reported via this\r
94          *             exception. In the first case the information on the limit\r
95          *             could be obtained from an exception.\r
96          * @throws WrongParameterException\r
97          *             is throws when 1) One of the Options provided is not\r
98          *             supported, 2) The value of the option is defined outside the\r
99          *             boundaries. In both cases exception object contain the\r
100          *             information on the violating Option.\r
101          * @throws InvalidParameterException\r
102          *             thrown if input list of fasta sequence is null or empty\r
103          * @throws UnsupportedRuntimeException\r
104          *             thrown if server OS does not support native executables for a\r
105          *             given web service, e.g. JABAWS is deployed on Windows and\r
106          *             Mafft service is called\r
107          * @throws LimitExceededException\r
108          *             is throw if the input sequences number or average length\r
109          *             exceeds what is defined by the limit\r
110          * @see Option\r
111          */\r
112         @WebMethod\r
113         String customAnalize(\r
114                         @WebParam(name = "fastaSequences") List<FastaSequence> sequences,\r
115                         @WebParam(name = "options") List<Option<T>> options)\r
116                         throws UnsupportedRuntimeException, LimitExceededException,\r
117                         JobSubmissionException, WrongParameterException;\r
118 \r
119         /**\r
120          * Analyse the sequences according to the preset settings. The actual\r
121          * analysis algorithm is defined by the type T.\r
122          * \r
123          * Limit for a presetName is used whether the calculation will be permitted\r
124          * or denied. If no Limit was defined for a presetName, than default limit\r
125          * is used.\r
126          * \r
127          * @param sequences\r
128          *            List of FastaSequence objects. The programme does not perform\r
129          *            any sequence validity checks. Nor does it checks whether the\r
130          *            sequences names are unique. It is responsibility of the caller\r
131          *            to validate this information\r
132          * @param preset\r
133          *            A list of Options\r
134          * @return String - jobId - unique identifier for the job\r
135          * @throws JobSubmissionException\r
136          *             is thrown when the job could not be submitted due to the\r
137          *             following reasons: 1) The number of sequences in the\r
138          *             submission or their average length is greater then defined by\r
139          *             the default Limit. 2) Any problems on the server side e.g. it\r
140          *             is misconfigured or malfunction, is reported via this\r
141          *             exception. In the first case the information on the limit\r
142          *             could be obtained from an exception.\r
143          * @throws WrongParameterException\r
144          *             is throws when 1) One of the Options provided is not\r
145          *             supported, 2) The value of the option is defined outside the\r
146          *             boundaries. In both cases exception object contain the\r
147          *             information on the violating Option.\r
148          * @throws InvalidParameterException\r
149          *             thrown if input list of fasta sequence is null or empty\r
150          * @throws UnsupportedRuntimeException\r
151          *             thrown if server OS does not support native executables for a\r
152          *             given web service, e.g. JABAWS is deployed on Windows and\r
153          *             Mafft service is called\r
154          * @throws LimitExceededException\r
155          *             is throw if the input sequences number or average length\r
156          *             exceeds what is defined by the limit\r
157          */\r
158         @WebMethod\r
159         String presetAnalize(\r
160                         @WebParam(name = "fastaSequences") List<FastaSequence> sequences,\r
161                         @WebParam(name = "preset") Preset<T> preset)\r
162                         throws UnsupportedRuntimeException, LimitExceededException,\r
163                         JobSubmissionException, WrongParameterException;\r
164 \r
165         /**\r
166          * Return the result of the job.\r
167          * \r
168          * @param jobId\r
169          *            a unique job identifier\r
170          * @return the HashSet of Score objects\r
171          * @throws ResultNotAvailableException\r
172          *             this exception is throw if the job execution was not\r
173          *             successful or the result of the execution could not be found.\r
174          *             (e.g. removed). Exception could also be thrown is dues to the\r
175          *             lower level problems on the server i.e. IOException,\r
176          *             FileNotFoundException problems as well as\r
177          *             UnknownFileFormatException.\r
178          * @throws InvalidParameterException\r
179          *             thrown if jobId is empty or cannot be recognised e.g. in\r
180          *             invalid format\r
181          */\r
182         @WebMethod\r
183         HashSet<Score> getAnnotation(@WebParam(name = "jobId") String jobId)\r
184                         throws ResultNotAvailableException;\r
185 \r
186 }\r