1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.batch;
17
18 import java.util.ArrayList;
19 import java.util.HashMap;
20 import java.util.List;
21 import java.util.Map;
22
23 import org.kuali.ole.sys.batch.service.SchedulerService;
24 import org.quartz.JobDetail;
25 import org.springframework.beans.factory.BeanNameAware;
26
27 public class JobDescriptor implements BeanNameAware {
28 private String name;
29 private String namespaceCode;
30 private String group;
31 private Map<String, String> dependencies;
32 private List<Step> steps;
33 private SchedulerService schedulerService;
34 private boolean durable = true;
35
36 public JobDescriptor() {
37 dependencies = new HashMap();
38 steps = new ArrayList();
39 }
40
41 public JobDescriptor(String name, String group, Step step, boolean durable) {
42 this();
43 this.name = name;
44 this.group = group;
45 this.durable = durable;
46 steps.add(step);
47 }
48
49
50
51
52 public void setBeanName(String name) {
53 this.name = name;
54 }
55
56
57
58
59
60
61
62 public JobDetail getJobDetail() {
63 return new JobDetail(name, group, Job.class, false, durable, false);
64 }
65
66
67
68
69
70
71 public void setGroup(String group) {
72 this.group = group;
73 }
74
75
76
77
78
79
80 public void setDependencies(Map<String, String> dependencies) {
81 this.dependencies = dependencies;
82 }
83
84
85
86
87
88
89 public Map<String, String> getDependencies() {
90 return dependencies;
91 }
92
93
94
95
96
97
98 public void setSteps(List<Step> steps) {
99 this.steps = steps;
100 }
101
102
103
104
105
106
107 public List<Step> getSteps() {
108 return steps;
109 }
110
111
112
113
114
115
116 public void setSchedulerService(SchedulerService schedulerService) {
117 this.schedulerService = schedulerService;
118 }
119
120 public String getGroup() {
121 return group;
122 }
123
124 public String getName() {
125 return name;
126 }
127
128 public SchedulerService getSchedulerService() {
129 return schedulerService;
130 }
131
132 public boolean isDurable() {
133 return durable;
134 }
135
136 public void setDurable(boolean durable) {
137 this.durable = durable;
138 }
139
140
141
142
143
144 public String getNamespaceCode() {
145 return namespaceCode;
146 }
147
148
149
150
151
152 public void setNamespaceCode(String namespaceCode) {
153 this.namespaceCode = namespaceCode;
154 }
155
156 }