]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.core/src/main/java/org/argeo/slc/core/process/SlcExecutionStep.java
1 package org
.argeo
.slc
.core
.process
;
3 import java
.io
.IOException
;
4 import java
.io
.StringReader
;
5 import java
.io
.StringWriter
;
9 import java
.util
.Vector
;
11 import org
.apache
.commons
.io
.IOUtils
;
13 public class SlcExecutionStep
{
14 public final static String TYPE_LOG
= "LOG";
19 private List
<String
> logLines
= new Vector
<String
>();
21 /** Empty constructor */
22 public SlcExecutionStep() {
25 public SlcExecutionStep(String log
) {
27 this.begin
= new Date();
28 this.uuid
= UUID
.randomUUID().toString();
32 public String
getUuid() {
36 public void setUuid(String uuid
) {
40 public String
getType() {
44 public void setType(String type
) {
48 public Date
getBegin() {
52 public void setBegin(Date begin
) {
56 public List
<String
> getLogLines() {
60 public void setLogLines(List
<String
> logLines
) {
61 this.logLines
= logLines
;
64 public String
logAsString() {
65 StringWriter writer
= new StringWriter();
66 String log
= writer
.toString();
67 IOUtils
.closeQuietly(writer
);
71 public void addLog(String log
) {
76 List
<String
> lines
= IOUtils
.readLines(new StringReader(log
));
77 logLines
.addAll(lines
);
78 } catch (IOException e
) {
79 throw new RuntimeException("Cannot add log", e
);
84 public String
toString() {
85 return getClass().getSimpleName() + "#" + uuid
;