X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fslivkaws%2FSlivkaWSInstance.java;h=75e5722ac253cb9f50ed1870d4ea1c52d6a1ea80;hb=4898f0ae429e0c61ddba72ca46be89b34bb4df8b;hp=8a16edb400f5d9a5816b1a7c12dbbb69e015ba30;hpb=5a6ac5b535856903629234ad43a71319a91ebee5;p=jalview.git diff --git a/src/jalview/ws/slivkaws/SlivkaWSInstance.java b/src/jalview/ws/slivkaws/SlivkaWSInstance.java index 8a16edb..75e5722 100644 --- a/src/jalview/ws/slivkaws/SlivkaWSInstance.java +++ b/src/jalview/ws/slivkaws/SlivkaWSInstance.java @@ -54,7 +54,7 @@ public abstract class SlivkaWSInstance extends ServiceWithParameters stateMap.put(JobState.QUEUED, WsJob.JobState.QUEUED); stateMap.put(JobState.RUNNING, WsJob.JobState.RUNNING); stateMap.put(JobState.COMPLETED, WsJob.JobState.FINISHED); - stateMap.put(JobState.INTERRUPED, WsJob.JobState.CANCELLED); + stateMap.put(JobState.INTERRUPTED, WsJob.JobState.CANCELLED); stateMap.put(JobState.DELETED, WsJob.JobState.CANCELLED); stateMap.put(JobState.FAILED, WsJob.JobState.FAILED); stateMap.put(JobState.ERROR, WsJob.JobState.SERVERERROR); @@ -67,7 +67,7 @@ public abstract class SlivkaWSInstance extends ServiceWithParameters public SlivkaWSInstance(SlivkaClient client, SlivkaService service, String action) { - super(service.getName(), action, service.getLabel(), "Slivka", client.getUrl().toString()); + super(action, action, service.getLabel(), "Slivka", client.getUrl().toString()); this.client = client; this.service = service; } @@ -145,13 +145,20 @@ public abstract class SlivkaWSInstance extends ServiceWithParameters public final boolean updateJobProgress(WsJob job) throws IOException { List files = client.getJobResults(job.getJobId()); - Optional logFile = files.stream() - .filter(f -> f.getLabel().equals("log")).findFirst(); + RemoteFile logFile=null; + for (RemoteFile f : files) + { + if (f.getLabel().equals("log")) + { + logFile = f; break; + } + } + boolean newContent = false; - if (logFile.isPresent()) + if (logFile!=null) { ByteArrayOutputStream output = new ByteArrayOutputStream(); - logFile.get().writeTo(output); + logFile.writeTo(output); if (output.size() > job.getNextChunk()) { newContent = true; @@ -161,12 +168,21 @@ public abstract class SlivkaWSInstance extends ServiceWithParameters } if (failedStates.contains(job.getJobState())) { - Optional errLogFile = files.stream() - .filter(f -> f.getLabel().equals("error-log")).findFirst(); - if (errLogFile.isPresent()) + + RemoteFile errLogFile = null; + for (RemoteFile f : files) + { + if (f.getLabel().equals("error-log")) + { + errLogFile = f; + break; + } + } + + if (errLogFile!=null) { ByteArrayOutputStream output = new ByteArrayOutputStream(); - errLogFile.get().writeTo(output); + errLogFile.writeTo(output); if (output.size() > 0) { newContent = true;