1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.batch;
17
18 import java.util.List;
19
20 import org.kuali.ole.gl.batch.service.CollectorReportService;
21 import org.kuali.ole.gl.batch.service.CollectorService;
22 import org.kuali.ole.gl.report.CollectorReportData;
23 import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
24 import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
25
26
27
28
29
30
31
32 public class CollectorStep extends AbstractWrappedBatchStep {
33 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CollectorStep.class);
34
35 private CollectorService collectorService;
36 private CollectorReportService collectorReportService;
37
38
39
40
41 @Override
42 public List<String> getRequiredDirectoryNames() {
43 return collectorService.getRequiredDirectoryNames();
44 }
45
46 @Override
47 protected CustomBatchExecutor getCustomBatchExecutor() {
48 return new CustomBatchExecutor() {
49 public boolean execute() {
50 CollectorReportData collectorReportData = collectorService.performCollection();
51 collectorReportService.sendEmails(collectorReportData);
52 collectorReportService.generateCollectorRunReports(collectorReportData);
53
54 collectorService.finalizeCollector(collectorReportData);
55 return true;
56 }
57 };
58 }
59
60
61
62
63
64
65 public CollectorService getCollectorService() {
66 return collectorService;
67 }
68
69
70
71
72
73
74 public void setCollectorService(CollectorService collectorService) {
75 this.collectorService = collectorService;
76 }
77
78
79
80
81
82
83 public CollectorReportService getCollectorReportService() {
84 return collectorReportService;
85 }
86
87
88
89
90
91
92 public void setCollectorReportService(CollectorReportService collectorReportService) {
93 this.collectorReportService = collectorReportService;
94 }
95 }