From 47b802c67970e1d0d90ad1b2200d905225bcb5c3 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Mon, 23 Sep 2019 14:07:43 +0100 Subject: [PATCH] JAL-3066 Move common web service methods to abstract SlivkaWSInstance ServiceWithParameters and JalviewWebService overriden methods would be common to both Msa and Annotation services thus they are moved to the common abstract base class. --- j11lib/slivka-client.jar | Bin 116952 -> 145051 bytes .../ws/slivkaws/SlivkaMsaServiceInstance.java | 95 +++++++++++++++ src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java | 2 +- src/jalview/ws/slivkaws/SlivkaWSInstance.java | 122 ++++---------------- 4 files changed, 120 insertions(+), 99 deletions(-) create mode 100644 src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java diff --git a/j11lib/slivka-client.jar b/j11lib/slivka-client.jar index 12cc028bf8119347640aa2c26be81e228d7ae786..c990dd83429983ab161778250d6d23fca96db845 100644 GIT binary patch delta 26736 zcmeHw3wT@AmG0V-ZOO9yQv8TxJCU6@mfx12@gol>u@fhboy1Op6G);silgAj#+K92 zUMhN_w9wK(PRpTC2#>h~Z3hT(i4B1yK%ul93T0+!FVksZ`nZ(dGE8TtckbNIaR0T> zk#r=>N$BI=Z@$k0S?BDt_gZVOz4zMdwNHL{r{&&XTT{1gHYa3})oP{h9BsZcb#Lk` zx7PO+ZCY4&bpp}VPagj#vodVT&pR^d_XVmq?da_u*tf2)cc7!Yw{v?MEyc2<%Bc5ZPVyACn05|=kljB3)mBoSa z$*I$p>&(i(Cl|UWhDOIwHqhBWQ0(-3j^cWY=a|>u>Kq*(u4Wki;a2^pxw^KxR_U`f z)X&{&X!L0H0q^8Qp!EnYk9zzEz2mL!>gGDM%TZ7^o~#XM*Taw*9#Jx1f{MU^-lym{=iPp$fP&%=CAI! z=j$K*HcfdyKdPeFu(shXOXrr92BQRNk@I znio;Na^Ha>tBne2iG>y`r|!-+JE=&SzPr*_lj&mfIlTI1RsAzmFipkf6;Dw~dF4}7T3+=Ol|702CaS>S z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kw1bD&@ffaUnyA5tMeKWOfaFwiJl&QOaoDl|m*y+e`}}K3j3>b`>#k z;AvJV_DLvbng$h!(9z0xU3?i6sXLgXxHo$HCoyPQJg5L@XlH1sU!A^obzMb?LEAA? Q>3(%9l@8 toalign, WsParamSetI parameters, List list) throws Throwable + { + StringBuilder builder = new StringBuilder(); + for (SequenceI seq : toalign) + { + builder.append(">").append(seq.getName()).append("\n"); + builder.append(seq.getSequence()).append("\n"); + } + InputStream stream = new ByteArrayInputStream(builder.toString().getBytes()); + RemoteFile file = client.uploadFile(stream, "input.fasta", "application/fasta"); + SlivkaForm form = service.getForm(); + HashMap values = new HashMap<>(list != null ? list.size() : 0); + if (list != null) + { + for (ArgumentI arg : list) + { + values.put(arg.getName(), arg.getValue()); + } + } + for (FormField field : form.getFields()) + { + switch (field.getType()) { + case FILE: + form.insert(field.getName(), file); + break; + case BOOLEAN: + String value = values.get(field.getName()); + form.insert(field.getName(), (value != null && !value.isBlank()) ? true : false); + break; + default: + form.insert(field.getName(), field.valueOf(values.get(field.getName()))); + } + } + return new JobId(service.getName(), service.getName(), form.submit()); + } + + @Override + public AlignmentI getAlignmentFor(JobId jobId) throws InvalidArgumentException, ServerError, IOError + { + List files; + try + { + files = client.getJobResults(jobId.getJobId()); + for (RemoteFile f : files) + { + if (f.getMimeType().equals("application/clustal")) + { + return new FormatAdapter().readFile(f.getURL().toString(), DataSourceType.URL, FileFormat.Clustal); + } + else if (f.getMimeType().equals("application/fasta")) + { + return new FormatAdapter().readFile(f.getURL().toString(), DataSourceType.URL, FileFormat.Fasta); + } + } + } catch (IOException e) + { + throw new IOError(e); + } + return null; + } +} diff --git a/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java b/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java index 009e388..54cfbc4 100644 --- a/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java +++ b/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java @@ -59,7 +59,7 @@ public class SlivkaWSDiscoverer } continue; } - SlivkaWSInstance instance = new SlivkaWSInstance(client, service); + SlivkaMsaServiceInstance instance = new SlivkaMsaServiceInstance(client, service); JMenuItem defaultEntry = new JMenuItem(String.format("%s with defaults", service.label)); defaultEntry.addActionListener((ActionEvent evt) -> { AlignmentView msa = alignFrame.gatherSequencesForAlignment(); diff --git a/src/jalview/ws/slivkaws/SlivkaWSInstance.java b/src/jalview/ws/slivkaws/SlivkaWSInstance.java index 8bb554a..751637c 100644 --- a/src/jalview/ws/slivkaws/SlivkaWSInstance.java +++ b/src/jalview/ws/slivkaws/SlivkaWSInstance.java @@ -1,48 +1,33 @@ package jalview.ws.slivkaws; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.SequenceI; import jalview.gui.WebserviceInfo; -import jalview.io.DataSourceType; -import jalview.io.FileFormat; -import jalview.io.FormatAdapter; import jalview.ws.api.JalviewServiceEndpointProviderI; -import jalview.ws.api.JobId; -import jalview.ws.api.MultipleSequenceAlignmentI; +import jalview.ws.api.JalviewWebServiceI; import jalview.ws.api.ServiceWithParameters; import jalview.ws.gui.WsJob; -import jalview.ws.params.ArgumentI; -import jalview.ws.params.InvalidArgumentException; import jalview.ws.params.ParamDatastoreI; import jalview.ws.params.ParamManager; -import jalview.ws.params.WsParamSetI; -import java.io.ByteArrayInputStream; import java.io.IOError; import java.io.IOException; -import java.io.InputStream; -import java.rmi.ServerError; import java.util.EnumMap; -import java.util.HashMap; -import java.util.List; -import uk.ac.dundee.compbio.slivkaclient.FormField; import uk.ac.dundee.compbio.slivkaclient.FormValidationException; import uk.ac.dundee.compbio.slivkaclient.JobState; -import uk.ac.dundee.compbio.slivkaclient.RemoteFile; import uk.ac.dundee.compbio.slivkaclient.SlivkaClient; -import uk.ac.dundee.compbio.slivkaclient.SlivkaForm; import uk.ac.dundee.compbio.slivkaclient.SlivkaService; import uk.ac.dundee.compbio.slivkaclient.ValidationException; -public class SlivkaWSInstance extends ServiceWithParameters - implements MultipleSequenceAlignmentI, JalviewServiceEndpointProviderI +public abstract class SlivkaWSInstance extends ServiceWithParameters + implements JalviewServiceEndpointProviderI, JalviewWebServiceI { - private SlivkaClient client; - private SlivkaService service; - private SlivkaDatastore store = null; + protected final SlivkaClient client; - private EnumMap stateMap = new EnumMap<>(JobState.class); + protected final SlivkaService service; + + protected SlivkaDatastore store = null; + + protected static final EnumMap stateMap = new EnumMap<>(JobState.class); { stateMap.put(JobState.PENDING, WsJob.JobState.QUEUED); stateMap.put(JobState.QUEUED, WsJob.JobState.QUEUED); @@ -53,37 +38,33 @@ public class SlivkaWSInstance extends ServiceWithParameters stateMap.put(JobState.UNKNOWN, WsJob.JobState.UNKNOWN); } - SlivkaWSInstance(SlivkaClient client, SlivkaService service) { - super(service.getName(), "Alignment", service.getName(), "Slivka", client.getUrl().toString()); + public SlivkaWSInstance(SlivkaClient client, SlivkaService service, String action) + { + super(service.getName(), action, service.getLabel(), "Slivka", client.getUrl().toString()); this.client = client; this.service = service; } @Override - public void updateStatus(WsJob job) + public final void updateStatus(WsJob job) { try { job.setState(stateMap.get(client.getJobState(job.getJobId()))); } catch (IOException e) { - throw new RuntimeException(e); + throw new IOError(e); } } - SlivkaService getService() - { - return service; - } - @Override - public boolean updateJobProgress(WsJob job) + public final boolean updateJobProgress(WsJob job) { return false; } @Override - public boolean handleSubmitError(Throwable _lex, WsJob j, WebserviceInfo wsInfo) + public final boolean handleSubmitError(Throwable _lex, WsJob j, WebserviceInfo wsInfo) { if (_lex instanceof FormValidationException) { @@ -102,81 +83,25 @@ public class SlivkaWSInstance extends ServiceWithParameters } @Override - public boolean handleCollectionException(Exception e, WsJob msjob, WebserviceInfo wsInfo) + public final boolean handleCollectionException(Exception e, WsJob msjob, WebserviceInfo wsInfo) { + // TODO return false; } - @Override - public JobId align(List toalign, WsParamSetI parameters, List list) throws Throwable - { - StringBuilder builder = new StringBuilder(); - for (SequenceI seq : toalign) - { - builder.append(">").append(seq.getName()).append("\n"); - builder.append(seq.getSequence()).append("\n"); - } - InputStream stream = new ByteArrayInputStream(builder.toString().getBytes()); - RemoteFile file = client.uploadFile(stream, "input.fasta", "application/fasta"); - SlivkaForm form = service.getForm(); - HashMap values = new HashMap<>(list != null ? list.size() : 0); - if (list != null) - { - for (ArgumentI arg : list) - { - values.put(arg.getName(), arg.getValue()); - } - } - for (FormField field : form.getFields()) - { - switch (field.getType()) { - case FILE: - form.insert(field.getName(), file); - break; - case BOOLEAN: - String value = values.get(field.getName()); - form.insert(field.getName(), (value != null && !value.isBlank()) ? true : false); - break; - default: - form.insert(field.getName(), field.valueOf(values.get(field.getName()))); - } - } - return new JobId(service.getName(), service.getName(), form.submit()); - } - - @Override - public AlignmentI getAlignmentFor(JobId jobId) throws InvalidArgumentException, ServerError, IOError + final SlivkaService getService() { - List files; - try - { - files = client.getJobResults(jobId.getJobId()); - for (RemoteFile f : files) - { - if (f.getMimeType().equals("application/clustal")) - { - return new FormatAdapter().readFile(f.getURL().toString(), DataSourceType.URL, FileFormat.Clustal); - } - else if (f.getMimeType().equals("application/fasta")) - { - return new FormatAdapter().readFile(f.getURL().toString(), DataSourceType.URL, FileFormat.Fasta); - } - } - } catch (IOException e) - { - throw new IOError(e); - } - return null; + return service; } @Override - public Object getEndpoint() + public final Object getEndpoint() { return this; } @Override - public void initParamStore(ParamManager userParameterStore) + public final void initParamStore(ParamManager userParameterStore) { if (store == null) { @@ -197,8 +122,9 @@ public class SlivkaWSInstance extends ServiceWithParameters } @Override - public ParamDatastoreI getParamStore() + public final ParamDatastoreI getParamStore() { return store; } + } -- 1.7.10.2