\r
import java.io.File;\r
import java.io.FileWriter;\r
-import java.text.SimpleDateFormat;\r
-import java.util.Date;\r
import java.util.HashMap;\r
import java.util.List;\r
import java.util.Map;\r
\r
import org.apache.commons.io.IOUtils;\r
import org.argeo.slc.SlcException;\r
+import org.argeo.slc.execution.ExecutionProcess;\r
import org.argeo.slc.process.SlcExecution;\r
import org.argeo.slc.process.SlcExecutionNotifier;\r
import org.argeo.slc.process.SlcExecutionStep;\r
import org.springframework.oxm.Marshaller;\r
\r
+/** @deprecated Probably not even working anymore */\r
public class FileSlcExecutionNotifier implements SlcExecutionNotifier {\r
- private final static SimpleDateFormat sdf = new SimpleDateFormat(\r
- "yyyyMMdd-HHmmss");\r
-\r
- private String basePath;\r
+// private final static SimpleDateFormat sdf = new SimpleDateFormat(\r
+// "yyyyMMdd-HHmmss");\r
+//\r
+// private String basePath;\r
private Marshaller marshaller;\r
\r
private Map<String, String> uuidToDir = new HashMap<String, String>();\r
\r
- public void addSteps(SlcExecution slcExecution,\r
+ public void addSteps(ExecutionProcess slcExecution,\r
List<SlcExecutionStep> additionalSteps) {\r
writeSlcExecution(slcExecution);\r
}\r
\r
- public void newExecution(SlcExecution slcExecution) {\r
- String dirPath = basePath + File.separator + sdf.format(new Date())\r
- + '-' + slcExecution.getUuid();\r
- File dir = new File(dirPath);\r
- dir.mkdirs();\r
-\r
- uuidToDir.put(slcExecution.getUuid(), dirPath);\r
-\r
- writeSlcExecution(slcExecution);\r
- }\r
-\r
- public void updateExecution(SlcExecution slcExecution) {\r
- writeSlcExecution(slcExecution);\r
- }\r
-\r
- public void updateStatus(SlcExecution slcExecution, String oldStatus,\r
+ public void updateStatus(ExecutionProcess slcExecution, String oldStatus,\r
String newStatus) {\r
writeSlcExecution(slcExecution);\r
}\r
\r
- protected void writeSlcExecution(SlcExecution slcExecution) {\r
+ protected void writeSlcExecution(ExecutionProcess process) {\r
+ if (!(process instanceof SlcExecution))\r
+ throw new SlcException("Unsupported process type "\r
+ + process.getClass());\r
+ SlcExecution slcExecution = (SlcExecution) process;\r
FileWriter out = null;\r
try {\r
out = new FileWriter(getFilePath(slcExecution));\r
}\r
\r
public void setBasePath(String basePath) {\r
- this.basePath = basePath;\r
+ //this.basePath = basePath;\r
}\r
\r
public void setMarshaller(Marshaller marshaller) {\r