From 2ef73c11830207abbb8b493f8b47258b5a989088 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 24 Sep 2021 15:08:34 +0200 Subject: [PATCH] JAL-3878 Move WSJob instantiation out of WebService classes. --- src/jalview/ws2/WSJob.java | 17 +++++++---------- src/jalview/ws2/WebServiceI.java | 3 ++- src/jalview/ws2/slivka/SlivkaWebService.java | 9 ++++++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/jalview/ws2/WSJob.java b/src/jalview/ws2/WSJob.java index 90ee0b7..0de6b22 100755 --- a/src/jalview/ws2/WSJob.java +++ b/src/jalview/ws2/WSJob.java @@ -37,7 +37,7 @@ public final class WSJob implements Serializable private String serviceName = ""; /* Server-side identifier */ - private String jobID = ""; + private String jobId = ""; private WSJobStatus status = WSJobStatus.UNKNOWN; @@ -56,12 +56,10 @@ public final class WSJob implements Serializable { } - public WSJob(String serviceProvider, String serviceName, String jobID, - String hostName) + public WSJob(String serviceProvider, String serviceName, String hostName) { this.serviceProvider = serviceProvider; this.serviceName = serviceName; - this.jobID = jobID; this.hostName = hostName; } @@ -69,7 +67,7 @@ public final class WSJob implements Serializable public String toString() { return format("%s:%s [%s] Created %s", serviceProvider, serviceName, - jobID, creationTime); + jobId, creationTime); } public int getJobNum() @@ -143,14 +141,14 @@ public final class WSJob implements Serializable this.serviceName = serviceName; } - public String getJobID() + public String getJobId() { - return jobID; + return jobId; } - public void setJobID(String jobID) + public void setJobId(String jobID) { - this.jobID = jobID; + this.jobId = jobID; } public String getHostName() @@ -194,5 +192,4 @@ public final class WSJob implements Serializable { pcs.removePropertyChangeListener(propertyName, listener); } - } diff --git a/src/jalview/ws2/WebServiceI.java b/src/jalview/ws2/WebServiceI.java index d93dd9a..954bab7 100755 --- a/src/jalview/ws2/WebServiceI.java +++ b/src/jalview/ws2/WebServiceI.java @@ -23,6 +23,7 @@ import jalview.ws2.operations.Operation; public interface WebServiceI { public String getHostName(); + public String getProviderName(); public String getName(); public String getDescription(); public String getOperationType(); @@ -30,7 +31,7 @@ public interface WebServiceI public boolean hasParameters(); public ParamDatastoreI getParamStore(); - public WSJob submit(List sequences, List args) + public String submit(List sequences, List args) throws IOException; public void updateProgress(WSJob job) diff --git a/src/jalview/ws2/slivka/SlivkaWebService.java b/src/jalview/ws2/slivka/SlivkaWebService.java index a3aa226..e7800ad 100644 --- a/src/jalview/ws2/slivka/SlivkaWebService.java +++ b/src/jalview/ws2/slivka/SlivkaWebService.java @@ -73,6 +73,9 @@ public class SlivkaWebService implements WebServiceI public String getHostName() { return client.getUrl().toString(); } @Override + public String getProviderName() { return "slivka"; } + + @Override public String getName() { return service.getName(); } @Override @@ -108,7 +111,7 @@ public class SlivkaWebService implements WebServiceI } @Override - public WSJob submit(List sequences, List args) throws IOException + public String submit(List sequences, List args) throws IOException { var request = new uk.ac.dundee.compbio.slivkaclient.JobRequest(); for (Parameter param : service.getParameters()) { @@ -157,7 +160,7 @@ public class SlivkaWebService implements WebServiceI } } var job = service.submitJob(request); - return new WSJob("slivka", getName(), job.getId(), getHostName()); + return job.getId(); } @Override @@ -193,7 +196,7 @@ public class SlivkaWebService implements WebServiceI public AlignmentI getAlignment(WSJob job) throws IOException { Collection files; - var slivkaJob = client.getJob(job.getJobID()); + var slivkaJob = client.getJob(job.getJobId()); files = slivkaJob.getResults(); for (RemoteFile f : files) { if (f.getMediaType().equals("application/clustal")) { -- 1.7.10.2