1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.gwe.persistence.model.live;
18
19 import org.gwe.persistence.model.JobInfo;
20 import org.gwe.persistence.model.OrderExecutionProfileInfo;
21 import org.gwe.persistence.model.OrderInfo;
22 import org.gwe.persistence.model.order.OrderDescriptor;
23
24
25
26
27
28 public class JobLive {
29
30 private JobInfo info;
31 private OrderLive orderLive;
32
33 public JobLive(JobInfo job, OrderLive orderLive) {
34 this.info = job;
35 this.orderLive = orderLive;
36 }
37
38 public JobInfo getInfo() {
39 return info;
40 }
41
42 public OrderLive getOrderLive() {
43 return orderLive;
44 }
45
46 public OrderInfo getOrderInfo() {
47 return orderLive.getInfo();
48 }
49
50 public String getWorkspacePath() {
51 return info.getWorkspaceInDaemon(orderLive.getConfig());
52 }
53
54 public boolean canCleanUp() {
55 OrderExecutionProfileInfo execProfile = orderLive.getInfo().getExecutionProfile();
56 return execProfile.isCleanUpModeAlways() || (execProfile.isCleanUpModeOnSuccess() && info.getExecution() != null);
57 }
58
59 public <OD_TYPE extends OrderDescriptor> OD_TYPE getOrderDescriptor() {
60 return (OD_TYPE) getOrderInfo().getDescriptor();
61 }
62 }