d93dd9a902906febdcaf7f5506e976aaafeb19a8
[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
14  * to submit, track and cancel the jobs running on the server as well as
15  * retrieve the results.
16  * The instances should not depend on any other jalview components, especially
17  * must be oblivious to the existence of any UI.
18  * They are used by other classes such as WebServiceWorkers rather than
19  * manipulate data themselves.
20  *
21  * @author mmwarowny
22  */
23 public interface WebServiceI
24 {
25   public String getHostName();
26   public String getName();
27   public String getDescription();
28   public String getOperationType();
29   public List<Operation> getOperations();
30   public boolean hasParameters();
31   public ParamDatastoreI getParamStore();
32
33   public WSJob submit(List<SequenceI> sequences, List<ArgumentI> args)
34           throws IOException;
35
36   public void updateProgress(WSJob job)
37       throws IOException;
38
39 //  public <T> ResultSupplier<T> getResultSupplier(Class<T> type);
40
41   public void cancel(WSJob job) throws IOException;
42
43   /**
44    * Handle an exception that happened during job submission.
45    * If the exception was handled property by this method, it
46    * returns true. Otherwise, returns false indicating the exception
47    * should be handled by the caller.
48    */
49   public boolean handleSubmissionError(WSJob job, Exception ex);
50
51   public boolean handleCollectionError(WSJob job, Exception ex);
52
53 }