JAL-3878 Move operation type from WebService to Operation.
[jalview.git] / src / jalview / ws2 / WebServiceI.java
1 package jalview.ws2;
2
3 import java.io.IOException;
4 import java.util.List;
5
6 import jalview.datamodel.SequenceI;
7 import jalview.ws.params.ArgumentI;
8 import jalview.ws.params.ParamDatastoreI;
9 import jalview.ws.params.WsParamSetI;
10 import jalview.ws2.operations.Operation;
11
12 /**
13  * Provides information about the web service and sub-routines to submit, track
14  * and cancel the jobs running on the server as well as retrieve the results.
15  * The instances should not depend on any other jalview components, especially
16  * must be oblivious to the existence of any UI. They are used by other classes
17  * such as WebServiceWorkers rather than manipulate data themselves.
18  *
19  * @author mmwarowny
20  */
21 public interface WebServiceI
22 {
23   public String getHostName();
24
25   public String getProviderName();
26
27   public String getName();
28
29   public String getDescription();
30
31   public List<Operation> getOperations();
32
33   public boolean hasParameters();
34
35   public ParamDatastoreI getParamStore();
36
37   public String submit(List<SequenceI> sequences, List<ArgumentI> args)
38           throws IOException;
39
40   public void updateProgress(WSJob job) throws IOException;
41
42   // public <T> ResultSupplier<T> getResultSupplier(Class<T> type);
43
44   public void cancel(WSJob job) throws IOException;
45
46   /**
47    * Handle an exception that happened during job submission. If the exception
48    * was handled property by this method, it returns true. Otherwise, returns
49    * false indicating the exception should be handled by the caller.
50    */
51   public boolean handleSubmissionError(WSJob job, Exception ex);
52
53   public boolean handleCollectionError(WSJob job, Exception ex);
54
55 }