]>
git.argeo.org Git - gpl/argeo-slc.git/blob - SlcExecutionStep.java
235b617e500f75cd6d95ae1265a86b4325eb1c68
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org
.argeo
.slc
.process
;
19 import java
.util
.ArrayList
;
20 import java
.util
.Date
;
21 import java
.util
.List
;
22 import java
.util
.StringTokenizer
;
23 import java
.util
.UUID
;
25 public class SlcExecutionStep
{
26 public final static String TYPE_START
= "START";
27 public final static String TYPE_END
= "END";
28 public final static String TYPE_PHASE_START
= "PHASE_START";
29 public final static String TYPE_PHASE_END
= "PHASE_END";
30 public final static String TYPE_LOG
= "LOG";
32 private String uuid
= UUID
.randomUUID().toString();
34 private Date begin
= new Date();
35 private List
<String
> logLines
= new ArrayList
<String
>();
37 /** Empty constructor */
38 public SlcExecutionStep() {
41 /** Creates a step of type LOG. */
42 public SlcExecutionStep(String log
) {
46 /** Creates a step of the given type. */
47 public SlcExecutionStep(String type
, String log
) {
52 public String
getUuid() {
56 public void setUuid(String uuid
) {
60 public String
getType() {
64 public void setType(String type
) {
68 public Date
getBegin() {
72 public void setBegin(Date begin
) {
76 public List
<String
> getLogLines() {
80 public void setLogLines(List
<String
> logLines
) {
81 this.logLines
= logLines
;
84 public void addLog(String log
) {
88 StringTokenizer st
= new StringTokenizer(log
, "\n");
89 while (st
.hasMoreTokens())
90 logLines
.add(st
.nextToken());
94 public String
toString() {
95 return getClass().getSimpleName() + "#" + uuid
;