package jalview.ws2.client.api; import java.io.IOException; import java.util.List; import jalview.datamodel.SequenceI; import jalview.ws.params.ArgumentI; import jalview.ws2.api.Credentials; import jalview.ws2.api.WebServiceJob; public interface WebServiceClientI { /** * Get the hostname/url of the remote server which is supplying the service. * * @return host name */ String getUrl(); /** * Get the name of the web service client. * * @return client name */ String getClientName(); /** * Submit new job to the service with the supplied input sequences and * arguments. Optionally, some services may require additional credentials to * run. Implementations should perform all data serialization necessary for * the job submission, start a new job on the remote server and return a * handler for that job. * * @param sequences * input sequences * @param args * user provided arguments * @param credentials * optional user credentials needed to run the job * @return job handler * @throws IOException * submission failed due to a connection error */ WebServiceJob submit(List sequences, List args, Credentials credentials) throws IOException; /** * Poll the server and update the progress of the running job accordingly. * Implementations should fetch the current job status from the server and * update the status and log strings on the provided job object. * * @param job * job to update * @throws IOException * server error occurred */ void updateProgress(WebServiceJob job) throws IOException; /** * Send the cancellation request to the server for the specified job. * * @param job * job to cancel * @throws IOException * server error occurred * @throws UnsupportedOperationException * server does not support job cancellation */ void cancel(WebServiceJob job) throws IOException, UnsupportedOperationException; }