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.Date;
19
20 import org.kuali.rice.core.api.datetime.DateTimeService;
21 import org.quartz.SimpleTrigger;
22 import org.quartz.Trigger;
23
24 public class SimpleTriggerDescriptor extends TriggerDescriptor {
25 private Date startTime;
26 private long startDelay;
27 private int repeatCount;
28
29 public SimpleTriggerDescriptor() {
30 }
31
32 public SimpleTriggerDescriptor(String name, String group, String jobName, DateTimeService dateTimeService) {
33 setBeanName(name);
34 setGroup(group);
35 setJobName(jobName);
36 setDateTimeService(dateTimeService);
37 }
38
39
40
41
42 protected void completeTriggerDescription(Trigger trigger) {
43 if (startTime == null) {
44 startTime = trigger.getStartTime();
45 }
46
47 if (!isTestMode()) {
48 trigger.setStartTime(new Date(startTime.getTime() + startDelay));
49 ((SimpleTrigger) trigger).setRepeatCount(repeatCount);
50 }
51 else {
52 trigger.setStartTime(new Date(new Date().getTime() + 525600000L));
53 }
54 }
55
56
57
58
59
60
61 public void setRepeatCount(int repeatCount) {
62 this.repeatCount = repeatCount;
63 }
64
65
66
67
68
69
70 public void setStartTime(Date startTime) {
71 this.startTime = startTime;
72 }
73
74
75
76
77
78
79 public void setStartDelay(long startDelay) {
80 this.startDelay = startDelay;
81 }
82 }