]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecution.java
Compilation error with JDK 1.5
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / process / SlcExecution.java
1 package org.argeo.slc.process;
2
3 import java.io.Serializable;
4 import java.util.ArrayList;
5 import java.util.List;
6 import java.util.Map;
7 import java.util.TreeMap;
8
9 public class SlcExecution implements Serializable {
10 private static final long serialVersionUID = 1L;
11 public final static String STATUS_NONE = "DEFAULT";
12 public final static String STATUS_SCHEDULED = "SCHEDULED";
13 public final static String STATUS_RUNNING = "RUNNING";
14 public final static String STATUS_FINISHED = "FINISHED";
15 public final static String STATUS_ERROR = "ERROR";
16 public final static String STATUS_CLEANED = "CLEANED";
17
18 public final static String UNKOWN_HOST = "UNKOWN_HOST";
19
20 private String uuid;
21 private String host;
22 private String user;
23 private String type;
24 private String status = STATUS_NONE;
25 private Map<String, String> attributes = new TreeMap<String, String>();
26
27 private List<SlcExecutionStep> steps = new ArrayList<SlcExecutionStep>();
28 private List<RealizedFlow> realizedFlows = new ArrayList<RealizedFlow>();
29
30 public List<RealizedFlow> getRealizedFlows() {
31 return realizedFlows;
32 }
33
34 public void setRealizedFlows(List<RealizedFlow> realizedFlows) {
35 this.realizedFlows = realizedFlows;
36 }
37
38 public List<SlcExecutionStep> getSteps() {
39 return steps;
40 }
41
42 public void setSteps(List<SlcExecutionStep> steps) {
43 this.steps = steps;
44 }
45
46 public String getUuid() {
47 return uuid;
48 }
49
50 public void setUuid(String uuid) {
51 this.uuid = uuid;
52 }
53
54 public String getHost() {
55 return host;
56 }
57
58 public void setHost(String host) {
59 this.host = host;
60 }
61
62 public String getUser() {
63 return user;
64 }
65
66 public void setUser(String user) {
67 this.user = user;
68 }
69
70 public String getType() {
71 return type;
72 }
73
74 public void setType(String type) {
75 this.type = type;
76 }
77
78 public String getStatus() {
79 return status;
80 }
81
82 public void setStatus(String status) {
83 this.status = status;
84 }
85
86 public SlcExecutionStep currentStep() {
87 if (steps.size() > 0)
88 return steps.get(steps.size() - 1);
89 else
90 return null;
91 }
92
93 @Override
94 public boolean equals(Object obj) {
95 if (obj instanceof SlcExecution) {
96 return getUuid().equals(((SlcExecution) obj).getUuid());
97 }
98 return false;
99 }
100
101 @Override
102 public int hashCode() {
103 return getUuid().hashCode();
104 }
105
106 public Map<String, String> getAttributes() {
107 return attributes;
108 }
109
110 public void setAttributes(Map<String, String> attributes) {
111 this.attributes = attributes;
112 }
113
114 public String toString() {
115 StringBuffer buf = new StringBuffer(getClass().getSimpleName());
116 buf.append('#').append(uuid);
117 buf.append(" status=").append(status);
118 buf.append(" attributes=").append(attributes);
119 return buf.toString();
120 }
121 }