X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.specs%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fprocess%2FSlcExecutionStep.java;h=bc79688ff7033eb703b9f96dc5033aff872b3229;hb=b3c5eaf56f98afc3e1068c154320b51e10b6424b;hp=f3319bbe635fe3c33818f44a06e49c13234df3c4;hpb=968cc3909d8ed215fec2dd9cb9f1fad65e973daf;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecutionStep.java b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecutionStep.java index f3319bbe6..bc79688ff 100644 --- a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecutionStep.java +++ b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecutionStep.java @@ -22,31 +22,42 @@ import java.util.List; import java.util.StringTokenizer; import java.util.UUID; -public class SlcExecutionStep { - public final static String TYPE_START = "START"; - public final static String TYPE_END = "END"; - public final static String TYPE_PHASE_START = "PHASE_START"; - public final static String TYPE_PHASE_END = "PHASE_END"; - public final static String TYPE_LOG = "LOG"; +import org.argeo.slc.execution.ExecutionStep; + +/** + * An atomic step to be notified in during an {@link SlcExecution}. Can be a log + * or the start/end of a phase, etc. + * + * @deprecated use {@link ExecutionStep} instead + */ +public class SlcExecutionStep extends ExecutionStep { + private static final long serialVersionUID = -7308643628104726471L; private String uuid = UUID.randomUUID().toString(); - private String type; - private Date begin = new Date(); private List logLines = new ArrayList(); /** Empty constructor */ public SlcExecutionStep() { } - /** Creates a step of type LOG. */ + /** Creates a step at the current date of type INFO */ public SlcExecutionStep(String log) { - this(TYPE_LOG, log); + this(new Date(), INFO, log); } - /** Creates a step of the given type. */ + /** Creates a step at the current date */ public SlcExecutionStep(String type, String log) { - this.type = type; - addLog(log); + this(new Date(), type, log); + } + + /** Creates a step of the given type. */ + public SlcExecutionStep(Date timestamp, String type, String log) { + this(timestamp, type, log, Thread.currentThread().getName()); + } + + public SlcExecutionStep(Date timestamp, String type, String log, + String thread) { + super("UNKOWN_LOCATION", timestamp, type, log, thread); } public String getUuid() { @@ -57,20 +68,16 @@ public class SlcExecutionStep { this.uuid = uuid; } - public String getType() { - return type; - } - public void setType(String type) { this.type = type; } - public Date getBegin() { - return begin; + public void setTimestamp(Date begin) { + this.timestamp = begin; } - public void setBegin(Date begin) { - this.begin = begin; + public void setThread(String thread) { + this.thread = thread; } public List getLogLines() { @@ -81,13 +88,18 @@ public class SlcExecutionStep { this.logLines = logLines; } - public void addLog(String log) { + /** public for legacy reasons */ + public String addLog(String log) { + if (logLines == null) + logLines = new ArrayList(); + if (log == null) - return; + return null; StringTokenizer st = new StringTokenizer(log, "\n"); while (st.hasMoreTokens()) logLines.add(removeNonXmlChars(st.nextToken())); + return null; } /**