1 package net.sf.appstatus.core.batch;
2
3 import java.io.Serializable;
4 import java.util.Date;
5
6
7
8
9
10
11
12 public class BatchConfiguration implements Serializable, IBatchConfiguration {
13 private static final long serialVersionUID = 1L;
14
15 private String group;
16
17 private Date lastExecution;
18
19 private final IBatchScheduleManager manager;
20
21 private String name;
22
23 private String schedule;
24
25 public BatchConfiguration(IBatchScheduleManager manager) {
26 this.manager = manager;
27 }
28
29
30
31
32 public String getGroup() {
33 return group;
34 }
35
36
37
38
39 public Date getLastExecution() {
40 return lastExecution;
41 }
42
43
44
45
46 public String getName() {
47 return name;
48 }
49
50
51
52
53 public Date getNextExecution() {
54 return manager.getNextDate(schedule, new Date());
55 }
56
57
58
59
60 public String getSchedule() {
61 return schedule;
62 }
63
64
65
66
67
68 public void setGroup(String group) {
69 this.group = group;
70 }
71
72
73
74
75
76 public void setLastExecution(Date lastExecution) {
77 this.lastExecution = lastExecution;
78 }
79
80
81
82
83
84 public void setName(String name) {
85 this.name = name;
86 }
87
88
89
90
91
92 public void setSchedule(String executionExpr) {
93 this.schedule = executionExpr;
94 }
95 }