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=9b2422e7198df6f34282a805058dd5f497417318;hp=ed52f64ee8412ff5828d56c83965c86409f233fb;hpb=a8b3ab714506490ccbb1dad77094f25b462ecc2d;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 ed52f64ee..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 @@ -16,35 +16,28 @@ package org.argeo.slc.process; -import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.StringTokenizer; import java.util.UUID; -public class SlcExecutionStep implements Serializable { - private static final long serialVersionUID = -7308643628104726471L; +import org.argeo.slc.execution.ExecutionStep; - public final static String START = "START"; - public final static String END = "END"; - public final static String PHASE_START = "PHASE_START"; - public final static String PHASE_END = "PHASE_END"; - public final static String ERROR = "ERROR"; - public final static String WARNING = "WARNING"; - public final static String INFO = "INFO"; - public final static String DEBUG = "DEBUG"; - public final static String TRACE = "TRACE"; +/** + * 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 String thread; - private Date timestamp = new Date(); private List logLines = new ArrayList(); /** Empty constructor */ public SlcExecutionStep() { - thread = Thread.currentThread().getName(); } /** Creates a step at the current date of type INFO */ @@ -64,10 +57,7 @@ public class SlcExecutionStep implements Serializable { public SlcExecutionStep(Date timestamp, String type, String log, String thread) { - this.type = type; - this.timestamp = timestamp; - this.thread = thread; - addLog(log); + super("UNKOWN_LOCATION", timestamp, type, log, thread); } public String getUuid() { @@ -78,26 +68,14 @@ public class SlcExecutionStep implements Serializable { this.uuid = uuid; } - public String getType() { - return type; - } - public void setType(String type) { this.type = type; } - public Date getTimestamp() { - return timestamp; - } - public void setTimestamp(Date begin) { this.timestamp = begin; } - public String getThread() { - return thread; - } - public void setThread(String thread) { this.thread = thread; } @@ -110,13 +88,18 @@ public class SlcExecutionStep implements Serializable { 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; } /**