X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fprocess%2FSlcExecutionStep.java;h=50032d8cd35c4a41538779d328638940f65c98bf;hb=7a8f034133c1112e187e2a2bfd2c56a8d2452345;hp=b18411136fc3f29080f2f9a45894aaef65c805f0;hpb=8d05b68f46cccfcea47117b6116abbd14d1dfcee;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/process/SlcExecutionStep.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/process/SlcExecutionStep.java index b18411136..50032d8cd 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/process/SlcExecutionStep.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/process/SlcExecutionStep.java @@ -11,6 +11,8 @@ import java.util.Vector; import org.apache.commons.io.IOUtils; public class SlcExecutionStep { + public final static String TYPE_LOG = "LOG"; + private String uuid; private String type; private Date begin; @@ -20,8 +22,8 @@ public class SlcExecutionStep { public SlcExecutionStep() { } - public SlcExecutionStep(String type, String log) { - this.type = type; + public SlcExecutionStep(String log) { + this.type = TYPE_LOG; this.begin = new Date(); this.uuid = UUID.randomUUID().toString(); addLog(log); @@ -67,6 +69,9 @@ public class SlcExecutionStep { } public void addLog(String log) { + if (log == null) + return; + try { List lines = IOUtils.readLines(new StringReader(log)); logLines.addAll(lines); @@ -75,4 +80,9 @@ public class SlcExecutionStep { } } + @Override + public String toString() { + return getClass().getSimpleName() + "#" + uuid; + } + }