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;
10 import jalview.ws2.operations.Operation;
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.
21 public interface WebServiceI
24 * Get the hostname/url of the remote server which is supplying the service.
28 public String getHostName();
31 * Get the short name of the service supplier.
33 * @return short service supplier name
35 public String getProviderName();
38 * Get the name of the service
40 * @return service name
45 * Get the description of the service.
47 * @return service description
49 String getDescription();
52 * Return whether the service provider user-adjustable parameters.
54 * @return whether service has parameters
56 boolean hasParameters();
59 * Get a {@link ParamDatastoreI} object containing service parameters and
62 * @return service parameters and presets
64 public ParamDatastoreI getParamStore();
67 * Submit new job to the service with the supplied input sequences and
68 * arguments. Implementations should perform all data parsing necessary for
69 * the job submission and start a new job on the remote server.
74 * user provided arguments
77 * submission failed due to a connection error
79 public String submit(List<SequenceI> sequences, List<ArgumentI> args)
83 * Update the progress of the running job according to the state reported by
84 * the server. Implementations should fetch the current job status from the
85 * server and update status and log messages on the provided job object.
90 * server error occurred
92 public void updateProgress(WSJob job) throws IOException;
94 public void cancel(WSJob job) throws IOException;
97 * Handle an exception that happened during job submission. If the exception
98 * was handled property by this method, it returns true. Otherwise, returns
99 * false indicating the exception should be handled by the caller.
101 public boolean handleSubmissionError(WSJob job, Exception ex);
103 public boolean handleCollectionError(WSJob job, Exception ex);