X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.castor%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fxml%2Fprocess%2FFileSlcExecutionNotifier.java;h=93cde8ddf6f9157ad2b1b13452d7ad048333063d;hb=a181e3d059185a9dc108e81f38c66f48f4e4aac8;hp=fdc373e65e135079caecd26b7fe13fb8de057923;hpb=1fdb1b4e7b1d2b0cabb6483238301b857a6392fa;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/process/FileSlcExecutionNotifier.java b/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/process/FileSlcExecutionNotifier.java index fdc373e65..93cde8ddf 100644 --- a/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/process/FileSlcExecutionNotifier.java +++ b/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/process/FileSlcExecutionNotifier.java @@ -18,8 +18,6 @@ package org.argeo.slc.xml.process; import java.io.File; import java.io.FileWriter; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -28,46 +26,37 @@ import javax.xml.transform.stream.StreamResult; import org.apache.commons.io.IOUtils; import org.argeo.slc.SlcException; +import org.argeo.slc.execution.ExecutionProcess; import org.argeo.slc.process.SlcExecution; import org.argeo.slc.process.SlcExecutionNotifier; import org.argeo.slc.process.SlcExecutionStep; import org.springframework.oxm.Marshaller; +/** @deprecated Probably not even working anymore */ public class FileSlcExecutionNotifier implements SlcExecutionNotifier { - private final static SimpleDateFormat sdf = new SimpleDateFormat( - "yyyyMMdd-HHmmss"); - - private String basePath; +// private final static SimpleDateFormat sdf = new SimpleDateFormat( +// "yyyyMMdd-HHmmss"); +// +// private String basePath; private Marshaller marshaller; private Map uuidToDir = new HashMap(); - public void addSteps(SlcExecution slcExecution, + public void addSteps(ExecutionProcess slcExecution, List additionalSteps) { writeSlcExecution(slcExecution); } - public void newExecution(SlcExecution slcExecution) { - String dirPath = basePath + File.separator + sdf.format(new Date()) - + '-' + slcExecution.getUuid(); - File dir = new File(dirPath); - dir.mkdirs(); - - uuidToDir.put(slcExecution.getUuid(), dirPath); - - writeSlcExecution(slcExecution); - } - - public void updateExecution(SlcExecution slcExecution) { - writeSlcExecution(slcExecution); - } - - public void updateStatus(SlcExecution slcExecution, String oldStatus, + public void updateStatus(ExecutionProcess slcExecution, String oldStatus, String newStatus) { writeSlcExecution(slcExecution); } - protected void writeSlcExecution(SlcExecution slcExecution) { + protected void writeSlcExecution(ExecutionProcess process) { + if (!(process instanceof SlcExecution)) + throw new SlcException("Unsupported process type " + + process.getClass()); + SlcExecution slcExecution = (SlcExecution) process; FileWriter out = null; try { out = new FileWriter(getFilePath(slcExecution)); @@ -91,7 +80,7 @@ public class FileSlcExecutionNotifier implements SlcExecutionNotifier { } public void setBasePath(String basePath) { - this.basePath = basePath; + //this.basePath = basePath; } public void setMarshaller(Marshaller marshaller) {