]>
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
{
17 private List
<String
> logLines
= new Vector
<String
>();
19 /** Empty constructor */
20 public SlcExecutionStep() {
23 public SlcExecutionStep(String type
, String log
) {
25 this.begin
= new Date();
26 this.uuid
= UUID
.randomUUID().toString();
30 public String
getUuid() {
34 public void setUuid(String uuid
) {
38 public String
getType() {
42 public void setType(String type
) {
46 public Date
getBegin() {
50 public void setBegin(Date begin
) {
54 public List
<String
> getLogLines() {
58 public void setLogLines(List
<String
> logLines
) {
59 this.logLines
= logLines
;
62 public String
logAsString() {
63 StringWriter writer
= new StringWriter();
64 String log
= writer
.toString();
65 IOUtils
.closeQuietly(writer
);
69 public void addLog(String log
) {
74 List
<String
> lines
= IOUtils
.readLines(new StringReader(log
));
75 logLines
.addAll(lines
);
76 } catch (IOException e
) {
77 throw new RuntimeException("Cannot add log", e
);