1 package jalview.ws2.client.api;
3 import java.io.IOException;
6 import jalview.datamodel.SequenceI;
7 import jalview.ws.params.ArgumentI;
8 import jalview.ws2.api.Credentials;
9 import jalview.ws2.api.WebServiceJob;
12 * A common interface for all web service clients that provide methods to
13 * get the URL of the server the client is talking to, submit new jobs to the
14 * server as well as poll or cancel the running jobs. This interface does not
15 * provide means to retrieve job results as those may differ between
16 * web services. Specialized sub-interfaces define methods to retrieve job
17 * results appropriate for specific service types.
22 public interface WebServiceClientI
25 * Get the hostname/url of the remote server which is supplying the service.
32 * Get the name of the web service client.
36 String getClientName();
39 * Submit new job to the service with the supplied input sequences and
40 * arguments. Optionally, some services may require additional credentials to
41 * run. Implementations should perform all data serialization necessary for
42 * the job submission, start a new job on the remote server and return a
43 * handler for that job.
48 * user provided arguments
50 * optional user credentials needed to run the job
53 * submission failed due to a connection error
55 WebServiceJob submit(List<SequenceI> sequences, List<ArgumentI> args,
56 Credentials credentials) throws IOException;
59 * Poll the server and update the progress of the running job accordingly.
60 * Implementations should fetch the current job status from the server and
61 * update the status and log strings on the provided job object.
66 * server error occurred
68 void updateProgress(WebServiceJob job) throws IOException;
71 * Send the cancellation request to the server for the specified job.
76 * server error occurred
77 * @throws UnsupportedOperationException
78 * server does not support job cancellation
80 void cancel(WebServiceJob job) throws IOException, UnsupportedOperationException;