]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionStep.java
Start new SLC project structure
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / execution / ExecutionStep.java
index df2d805a897712a38c7b439bac184813ca679010..628a3b69dc6f1049253824729d2eeeb92504b4ef 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.execution;\r
 \r
 import java.io.Serializable;\r
@@ -26,8 +25,6 @@ import java.util.Date;
 public class ExecutionStep implements Serializable {\r
        private static final long serialVersionUID = 798640526532912161L;\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
@@ -36,6 +33,11 @@ public class ExecutionStep implements Serializable {
        public final static String DEBUG = "DEBUG";\r
        public final static String TRACE = "TRACE";\r
 \r
+       /** @deprecated */\r
+       public final static String START = "START";\r
+       /** @deprecated */\r
+       public final static String END = "END";\r
+\r
        // TODO make the fields final and private when we don't need POJO support\r
        // anymore (that\r
        // is when SlcExecutionStep is removed)\r
@@ -44,27 +46,28 @@ public class ExecutionStep implements Serializable {
        protected Date timestamp;\r
        protected String log;\r
 \r
+       private String location;\r
+\r
        /** Empty constructor */\r
        public ExecutionStep() {\r
-               thread = Thread.currentThread().getName();\r
-       }\r
-\r
-       /** Creates a step at the current date of type INFO */\r
-       public ExecutionStep(String log) {\r
-               this(new Date(), INFO, log);\r
+               Thread currentThread = Thread.currentThread();\r
+               thread = currentThread.getName();\r
        }\r
 \r
        /** Creates a step at the current date */\r
-       public ExecutionStep(String type, String log) {\r
-               this(new Date(), type, log);\r
+       public ExecutionStep(String location, String type, String log) {\r
+               this(location, new Date(), type, log);\r
        }\r
 \r
        /** Creates a step of the given type. */\r
-       public ExecutionStep(Date timestamp, String type, String log) {\r
-               this(timestamp, type, log, Thread.currentThread().getName());\r
+       public ExecutionStep(String location, Date timestamp, String type,\r
+                       String log) {\r
+               this(location, timestamp, type, log, Thread.currentThread().getName());\r
        }\r
 \r
-       public ExecutionStep(Date timestamp, String type, String log, String thread) {\r
+       public ExecutionStep(String location, Date timestamp, String type,\r
+                       String log, String thread) {\r
+               this.location = location;\r
                this.type = type;\r
                this.timestamp = timestamp;\r
                this.thread = thread;\r
@@ -100,4 +103,9 @@ public class ExecutionStep implements Serializable {
                return "Execution step, thread=" + thread + ", type=" + type;\r
        }\r
 \r
+       /** Typically the logging category */\r
+       public String getLocation() {\r
+               return location;\r
+       }\r
+\r
 }\r