X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws2%2Fclient%2Fapi%2FWebServiceClientI.java;h=49d097e20d14664d59d25c997d75512f25add443;hb=70cf5f7119077aaf887b90bf922adacb13b0af29;hp=e62909e53cedf7ce5911e62233aa3790f2f860b8;hpb=126fb8a77d8b741e1365e3d13dd06098ebf3ab72;p=jalview.git diff --git a/src/jalview/ws2/client/api/WebServiceClientI.java b/src/jalview/ws2/client/api/WebServiceClientI.java index e62909e..49d097e 100644 --- a/src/jalview/ws2/client/api/WebServiceClientI.java +++ b/src/jalview/ws2/client/api/WebServiceClientI.java @@ -6,15 +6,16 @@ import java.util.List; import jalview.datamodel.SequenceI; import jalview.ws.params.ArgumentI; import jalview.ws2.api.Credentials; -import jalview.ws2.api.WebServiceJob; +import jalview.ws2.api.JobStatus; +import jalview.ws2.api.WebServiceJobHandle; /** - * A common interface for all web service clients that provide methods to - * get the URL of the server the client is talking to, submit new jobs to the - * server as well as poll or cancel the running jobs. This interface does not - * provide means to retrieve job results as those may differ between - * web services. Specialized sub-interfaces define methods to retrieve job - * results appropriate for specific service types. + * A common interface for all web service clients that provide methods to get + * the URL of the server the client is talking to, submit new jobs to the server + * as well as poll or cancel the running jobs. This interface does not provide + * means to retrieve job results as those may differ between web services. + * Specialized sub-interfaces define methods to retrieve job results appropriate + * for specific service types. * * @author mmwarowny * @@ -52,20 +53,41 @@ public interface WebServiceClientI * @throws IOException * submission failed due to a connection error */ - WebServiceJob submit(List sequences, List args, + WebServiceJobHandle 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. + * Poll the server to get the current status of the job. * * @param job - * job to update + * web service job + * @return job status * @throws IOException - * server error occurred + * server communication error + */ + JobStatus getStatus(WebServiceJobHandle job) throws IOException; + + /** + * Retrieve log messages from the server for the job. + * + * @param job + * web service job + * @return log content + * @throws IOException + * server communication error + */ + String getLog(WebServiceJobHandle job) throws IOException; + + /** + * Retrieve error log messages from the server for the job. + * + * @param job + * web service job + * @return error log content + * @throws IOException + * server communication error */ - void updateProgress(WebServiceJob job) throws IOException; + String getErrorLog(WebServiceJobHandle job) throws IOException; /** * Send the cancellation request to the server for the specified job. @@ -77,5 +99,5 @@ public interface WebServiceClientI * @throws UnsupportedOperationException * server does not support job cancellation */ - void cancel(WebServiceJob job) throws IOException, UnsupportedOperationException; + void cancel(WebServiceJobHandle job) throws IOException, UnsupportedOperationException; }