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.JobStatus;
10 import jalview.ws2.api.WebServiceJobHandle;
13 * A common interface for all web service clients that provide methods to get
14 * the URL of the server the client is talking to, submit new jobs to the server
15 * as well as poll or cancel the running jobs. This interface does not provide
16 * means to retrieve job results as those may differ between web services.
17 * Specialized sub-interfaces define methods to retrieve job results appropriate
18 * for specific service types.
23 public interface WebServiceClientI
26 * Get the hostname/url of the remote server which is supplying the service.
33 * Get the name of the web service client.
37 String getClientName();
40 * Submit new job to the service with the supplied input sequences and
41 * arguments. Optionally, some services may require additional credentials to
42 * run. Implementations should perform all data serialization necessary for
43 * the job submission, start a new job on the remote server and return a
44 * handler for that job.
49 * user provided arguments
51 * optional user credentials needed to run the job
54 * submission failed due to a connection error
56 WebServiceJobHandle submit(List<SequenceI> sequences, List<ArgumentI> args,
57 Credentials credentials) throws IOException;
60 * Poll the server to get the current status of the job.
66 * server communication error
68 JobStatus getStatus(WebServiceJobHandle job) throws IOException;
71 * Retrieve log messages from the server for the job.
77 * server communication error
79 String getLog(WebServiceJobHandle job) throws IOException;
82 * Retrieve error log messages from the server for the job.
86 * @return error log content
88 * server communication error
90 String getErrorLog(WebServiceJobHandle job) throws IOException;
93 * Send the cancellation request to the server for the specified job.
98 * server error occurred
99 * @throws UnsupportedOperationException
100 * server does not support job cancellation
102 void cancel(WebServiceJobHandle job) throws IOException, UnsupportedOperationException;