1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.batch.service;
17
18 import java.util.Date;
19 import java.util.List;
20
21 import org.kuali.ole.sys.batch.BatchJobStatus;
22 import org.kuali.ole.sys.batch.Job;
23 import org.quartz.JobDetail;
24 import org.quartz.JobExecutionContext;
25 import org.quartz.Scheduler;
26
27 public interface SchedulerService {
28 public static final String SCHEDULE_JOB_NAME = "scheduleJob";
29
30 public static final String PENDING_JOB_STATUS_CODE = "Pending";
31 public static final String SCHEDULED_JOB_STATUS_CODE = "Scheduled";
32 public static final String RUNNING_JOB_STATUS_CODE = "Running";
33 public static final String SUCCEEDED_JOB_STATUS_CODE = "Succeeded";
34 public static final String FAILED_JOB_STATUS_CODE = "Failed";
35 public static final String CANCELLED_JOB_STATUS_CODE = "Cancelled";
36
37 public static final String JOB_STATUS_PARAMETER = "status";
38
39 public static final String SCHEDULED_GROUP = "scheduled";
40 public static final String UNSCHEDULED_GROUP = "unscheduled";
41
42 public void initialize();
43
44 public void initializeJob(String jobName, Job job);
45
46
47
48
49
50
51 public boolean hasIncompleteJob();
52
53
54
55
56
57
58
59
60 public boolean isPastScheduleCutoffTime();
61
62 public void processWaitingJobs();
63
64 public void logScheduleResults();
65
66 public boolean shouldNotRun(JobDetail jobDetail);
67
68 public String getStatus(JobDetail jobDetail);
69
70 public void updateStatus(JobDetail jobDetail, String jobStatus);
71
72 public void setScheduler(Scheduler scheduler);
73
74 public List<BatchJobStatus> getJobs(String groupName);
75
76
77
78
79
80
81 public List<BatchJobStatus> getJobs();
82
83
84
85
86
87
88
89
90 public BatchJobStatus getJob(String groupName, String jobName);
91
92
93
94
95
96
97
98
99
100 public void runJob(String jobName, int startStep, int stopStep, Date startTime, String requestorEmailAddress);
101
102
103 public void runJob(String groupName, String jobName, int startStep, int stopStep, Date jobStartTime, String requestorEmailAddress);
104
105
106
107
108
109
110 public void runJob(String jobName, String requestorEmailAddress);
111
112
113
114
115
116
117 public List<JobExecutionContext> getRunningJobs();
118
119
120
121
122
123
124 public void removeScheduled(String jobName);
125
126
127
128
129
130
131 public void addScheduled(JobDetail job);
132
133
134
135
136
137
138 public void addUnscheduled(JobDetail job);
139
140
141
142
143
144
145 public List<String> getSchedulerGroups();
146
147
148
149
150
151
152 public List<String> getJobStatuses();
153
154
155
156
157
158
159
160 public void interruptJob(String jobName);
161
162
163
164
165
166
167
168 public boolean isJobRunning(String jobName);
169
170
171
172
173
174
175
176 public Date getNextStartTime(BatchJobStatus job);
177
178
179
180
181
182
183
184
185 public Date getNextStartTime(String groupName, String jobName);
186
187 public void reinitializeScheduledJobs();
188 }