1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.argeo.slc.execution;
17
18 import java.io.Serializable;
19 import java.util.Date;
20
21
22
23
24
25 public class ExecutionStep implements Serializable {
26 private static final long serialVersionUID = 798640526532912161L;
27
28 public final static String PHASE_START = "PHASE_START";
29 public final static String PHASE_END = "PHASE_END";
30 public final static String ERROR = "ERROR";
31 public final static String WARNING = "WARNING";
32 public final static String INFO = "INFO";
33 public final static String DEBUG = "DEBUG";
34 public final static String TRACE = "TRACE";
35
36
37 public final static String START = "START";
38
39 public final static String END = "END";
40
41
42
43
44 protected String type;
45 protected String thread;
46 protected Date timestamp;
47 protected String log;
48
49 private String location;
50
51
52 public ExecutionStep() {
53 Thread currentThread = Thread.currentThread();
54 thread = currentThread.getName();
55 }
56
57
58 public ExecutionStep(String location, String type, String log) {
59 this(location, new Date(), type, log);
60 }
61
62
63 public ExecutionStep(String location, Date timestamp, String type,
64 String log) {
65 this(location, timestamp, type, log, Thread.currentThread().getName());
66 }
67
68 public ExecutionStep(String location, Date timestamp, String type,
69 String log, String thread) {
70 this.location = location;
71 this.type = type;
72 this.timestamp = timestamp;
73 this.thread = thread;
74 this.log = addLog(log);
75 }
76
77 public String getType() {
78 return type;
79 }
80
81 public Date getTimestamp() {
82 return timestamp;
83 }
84
85 public String getThread() {
86 return thread;
87 }
88
89
90
91
92
93 protected String addLog(String log) {
94 return log;
95 }
96
97 public String getLog() {
98 return log;
99 }
100
101 @Override
102 public String toString() {
103 return "Execution step, thread=" + thread + ", type=" + type;
104 }
105
106
107 public String getLocation() {
108 return location;
109 }
110
111 }