3 import java.io.IOException;
6 import jalview.datamodel.SequenceI;
7 import jalview.ws.params.ArgumentI;
8 import jalview.ws.params.ParamDatastoreI;
9 import jalview.ws.params.WsParamSetI;
12 * Provides information about the web service and sub-routines
13 * to submit and track the jobs running on the server as well as
14 * 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.
17 * They are used by other classes such as WebServiceWorkers rather than
18 * manipulate data themselves.
24 public interface JalviewWebServiceI<R>
26 public static final int PROTEIN_SERVICE = 0x01;
27 public static final int NUCLEOTIDE_SERVICE = 0x02;
28 public static final int ALIGNMENT_ANALYSIS = 0x04;
30 public String getHostName();
31 public String getName();
32 public String getDescription();
33 public String getOperationType();
34 public int getTypeFlags();
35 public boolean canSubmitGaps();
36 public int getMinSequences();
37 public int getMaxSequences();
38 public boolean hasParameters();
39 public ParamDatastoreI getParamStore();
41 public default boolean isProteinService() {
42 return (getTypeFlags() & PROTEIN_SERVICE) > 0;
44 public default boolean isNucleotideService() {
45 return (getTypeFlags() & NUCLEOTIDE_SERVICE) > 0;
47 public default boolean isAlignmentAnalysis() {
48 return (getTypeFlags() & ALIGNMENT_ANALYSIS) > 0;
51 public WSJobID submit(List<SequenceI> sequences, WsParamSetI preset,
52 List<ArgumentI> parameters) throws IOException;
54 public void updateProgress(WSJobID id, WSJobTrackerI tracker)
57 public R getResult(WSJobID id) throws IOException;
59 public void cancel(WSJobID id) throws IOException;
61 public boolean handleSubmissionError(WSJobID id, Throwable th,
62 WSJobTrackerI tracker);
64 public boolean handleCollectionError(WSJobID id, Throwable th,
65 WSJobTrackerI tracker);