package jalview.ws2; import java.io.IOException; import java.util.List; import jalview.datamodel.SequenceI; import jalview.ws.params.ArgumentI; import jalview.ws.params.ParamDatastoreI; import jalview.ws.params.WsParamSetI; /** * Provides information about the web service and sub-routines * to submit and track the jobs running on the server as well as * retrieve the results. * The instances should not depend on any other jalview components, especially * must be oblivious to the existence of any UI. * They are used by other classes such as WebServiceWorkers rather than * manipulate data themselves. * * @author mmwarowny * * @param */ public interface JalviewWebServiceI { public static final int PROTEIN_SERVICE = 0x01; public static final int NUCLEOTIDE_SERVICE = 0x02; public static final int ALIGNMENT_ANALYSIS = 0x04; public String getHostName(); public String getName(); public String getDescription(); public String getOperationType(); public int getTypeFlags(); public boolean canSubmitGaps(); public int getMinSequences(); public int getMaxSequences(); public boolean hasParameters(); public ParamDatastoreI getParamStore(); public default boolean isProteinService() { return (getTypeFlags() & PROTEIN_SERVICE) > 0; } public default boolean isNucleotideService() { return (getTypeFlags() & NUCLEOTIDE_SERVICE) > 0; } public default boolean isAlignmentAnalysis() { return (getTypeFlags() & ALIGNMENT_ANALYSIS) > 0; } public WSJobID submit(List sequences, WsParamSetI preset, List parameters) throws IOException; public void updateProgress(WSJobID id, WSJobTrackerI tracker) throws IOException; public R getResult(WSJobID id) throws IOException; public void cancel(WSJobID id) throws IOException; public boolean handleSubmissionError(WSJobID id, Throwable th, WSJobTrackerI tracker); public boolean handleCollectionError(WSJobID id, Throwable th, WSJobTrackerI tracker); }