954bab7648437e0310ff6f58134bf79444ba71c4
[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 getProviderName();
27   public String getName();
28   public String getDescription();
29   public String getOperationType();
30   public List<Operation> getOperations();
31   public boolean hasParameters();
32   public ParamDatastoreI getParamStore();
33
34   public String submit(List<SequenceI> sequences, List<ArgumentI> args)
35           throws IOException;
36
37   public void updateProgress(WSJob job)
38       throws IOException;
39
40 //  public <T> ResultSupplier<T> getResultSupplier(Class<T> type);
41
42   public void cancel(WSJob job) throws IOException;
43
44   /**
45    * Handle an exception that happened during job submission.
46    * If the exception was handled property by this method, it
47    * returns true. Otherwise, returns false indicating the exception
48    * should be handled by the caller.
49    */
50   public boolean handleSubmissionError(WSJob job, Exception ex);
51
52   public boolean handleCollectionError(WSJob job, Exception ex);
53
54 }