]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecutionStep.java
Add updateModule
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / process / SlcExecutionStep.java
index f3319bbe635fe3c33818f44a06e49c13234df3c4..ed52f64ee8412ff5828d56c83965c86409f233fb 100644 (file)
 \r
 package org.argeo.slc.process;\r
 \r
+import java.io.Serializable;\r
 import java.util.ArrayList;\r
 import java.util.Date;\r
 import java.util.List;\r
 import java.util.StringTokenizer;\r
 import java.util.UUID;\r
 \r
-public class SlcExecutionStep {\r
-       public final static String TYPE_START = "START";\r
-       public final static String TYPE_END = "END";\r
-       public final static String TYPE_PHASE_START = "PHASE_START";\r
-       public final static String TYPE_PHASE_END = "PHASE_END";\r
-       public final static String TYPE_LOG = "LOG";\r
+public class SlcExecutionStep implements Serializable {\r
+       private static final long serialVersionUID = -7308643628104726471L;\r
+\r
+       public final static String START = "START";\r
+       public final static String END = "END";\r
+       public final static String PHASE_START = "PHASE_START";\r
+       public final static String PHASE_END = "PHASE_END";\r
+       public final static String ERROR = "ERROR";\r
+       public final static String WARNING = "WARNING";\r
+       public final static String INFO = "INFO";\r
+       public final static String DEBUG = "DEBUG";\r
+       public final static String TRACE = "TRACE";\r
 \r
        private String uuid = UUID.randomUUID().toString();\r
        private String type;\r
-       private Date begin = new Date();\r
+       private String thread;\r
+       private Date timestamp = new Date();\r
        private List<String> logLines = new ArrayList<String>();\r
 \r
        /** Empty constructor */\r
        public SlcExecutionStep() {\r
+               thread = Thread.currentThread().getName();\r
        }\r
 \r
-       /** Creates a step of type LOG. */\r
+       /** Creates a step at the current date of type INFO */\r
        public SlcExecutionStep(String log) {\r
-               this(TYPE_LOG, log);\r
+               this(new Date(), INFO, log);\r
        }\r
 \r
-       /** Creates a step of the given type. */\r
+       /** Creates a step at the current date */\r
        public SlcExecutionStep(String type, String log) {\r
+               this(new Date(), type, log);\r
+       }\r
+\r
+       /** Creates a step of the given type. */\r
+       public SlcExecutionStep(Date timestamp, String type, String log) {\r
+               this(timestamp, type, log, Thread.currentThread().getName());\r
+       }\r
+\r
+       public SlcExecutionStep(Date timestamp, String type, String log,\r
+                       String thread) {\r
                this.type = type;\r
+               this.timestamp = timestamp;\r
+               this.thread = thread;\r
                addLog(log);\r
        }\r
 \r
@@ -65,12 +86,20 @@ public class SlcExecutionStep {
                this.type = type;\r
        }\r
 \r
-       public Date getBegin() {\r
-               return begin;\r
+       public Date getTimestamp() {\r
+               return timestamp;\r
+       }\r
+\r
+       public void setTimestamp(Date begin) {\r
+               this.timestamp = begin;\r
+       }\r
+\r
+       public String getThread() {\r
+               return thread;\r
        }\r
 \r
-       public void setBegin(Date begin) {\r
-               this.begin = begin;\r
+       public void setThread(String thread) {\r
+               this.thread = thread;\r
        }\r
 \r
        public List<String> getLogLines() {\r