01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.gl.batch.collector;
17:
18: import org.kuali.kfs.batch.AbstractStep;
19: import org.kuali.module.gl.service.CollectorReportService;
20: import org.kuali.module.gl.service.CollectorService;
21: import org.kuali.module.gl.util.CollectorReportData;
22:
23: /**
24: * Batch step that controls the collector process. The basic steps in the collector process are the following: 1) Retrieves files
25: * that need processed 2) Parses each file into a CollectorBatch object using the collector digester rules 3) Validation of contents
26: * in CollectorService 4) Stores origin group, gl entries, and id billings for each batch 5) Sends email to workgroup listed in the
27: * batch file header with process results 6) Cleans up .done files
28: */
29: public class CollectorStep extends AbstractStep {
30: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
31: .getLogger(CollectorStep.class);
32:
33: private CollectorService collectorService;
34: private CollectorReportService collectorReportService;
35:
36: /**
37: * Controls the collector process.
38: */
39: public boolean execute(String jobName) {
40: CollectorReportData collectorReportData = collectorService
41: .performCollection();
42: collectorReportService.sendEmails(collectorReportData);
43: collectorReportService
44: .generateCollectorRunReports(collectorReportData);
45: return true;
46: }
47:
48: /**
49: * Gets the collectorService attribute.
50: *
51: * @return Returns the collectorService.
52: */
53: public CollectorService getCollectorService() {
54: return collectorService;
55: }
56:
57: /**
58: * Sets the collectorService attribute value.
59: *
60: * @param collectorService The collectorService to set.
61: */
62: public void setCollectorService(CollectorService collectorService) {
63: this .collectorService = collectorService;
64: }
65:
66: /**
67: * Gets the collectorReportService attribute.
68: *
69: * @return Returns the collectorReportService.
70: */
71: public CollectorReportService getCollectorReportService() {
72: return collectorReportService;
73: }
74:
75: /**
76: * Sets the collectorReportService attribute value.
77: *
78: * @param collectorReportService The collectorReportService to set.
79: */
80: public void setCollectorReportService(
81: CollectorReportService collectorReportService) {
82: this.collectorReportService = collectorReportService;
83: }
84: }
|