]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecutionStep.java
Remove runtime packages
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / process / SlcExecutionStep.java
index 553845154bf35c5af5848230959b745c2c52347a..f88cf2533d7d56f06ef027f24ac36a83d98fd3be 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
  */\r
-\r
 package org.argeo.slc.process;\r
 \r
 import java.util.ArrayList;\r
@@ -22,26 +21,22 @@ import java.util.List;
 import java.util.StringTokenizer;\r
 import java.util.UUID;\r
 \r
-public class SlcExecutionStep {\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
+import org.argeo.slc.execution.ExecutionStep;\r
+\r
+/**\r
+ * An atomic step to be notified in during an {@link SlcExecution}. Can be a log\r
+ * or the start/end of a phase, etc.\r
+ * \r
+ * @deprecated use {@link ExecutionStep} instead\r
+ */\r
+public class SlcExecutionStep extends ExecutionStep {\r
+       private static final long serialVersionUID = -7308643628104726471L;\r
 \r
        private String uuid = UUID.randomUUID().toString();\r
-       private String type;\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 at the current date of type INFO */\r
@@ -61,10 +56,7 @@ public class SlcExecutionStep {
 \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
+               super("UNKOWN_LOCATION", timestamp, type, log, thread);\r
        }\r
 \r
        public String getUuid() {\r
@@ -75,26 +67,14 @@ public class SlcExecutionStep {
                this.uuid = uuid;\r
        }\r
 \r
-       public String getType() {\r
-               return type;\r
-       }\r
-\r
        public void setType(String type) {\r
                this.type = type;\r
        }\r
 \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 setThread(String thread) {\r
                this.thread = thread;\r
        }\r
@@ -107,13 +87,18 @@ public class SlcExecutionStep {
                this.logLines = logLines;\r
        }\r
 \r
-       public void addLog(String log) {\r
+       /** public for legacy reasons */\r
+       public String addLog(String log) {\r
+               if (logLines == null)\r
+                       logLines = new ArrayList<String>();\r
+\r
                if (log == null)\r
-                       return;\r
+                       return null;\r
 \r
                StringTokenizer st = new StringTokenizer(log, "\n");\r
                while (st.hasMoreTokens())\r
                        logLines.add(removeNonXmlChars(st.nextToken()));\r
+               return null;\r
        }\r
 \r
        /**\r