01: /*
02: * Copyright 2006-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;
17:
18: import org.kuali.kfs.batch.AbstractStep;
19: import org.kuali.kfs.batch.TestingStep;
20: import org.kuali.module.gl.service.SufficientFundsSyncService;
21:
22: /**
23: * A step to run the sufficient funds sync process. One typically doesn't need to do this - which is why it's marked as TestingStep -
24: * as Account, Chart, and Object Code records, when saved, will populate the sufficient funds tables, making this task redundant.
25: * However, if that information has not been built, this job will generate that information.
26: */
27: public class SufficientFundsSyncStep extends AbstractStep implements
28: TestingStep {
29: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
30: .getLogger(SufficientFundsSyncStep.class);
31: private SufficientFundsSyncService sufficientFundsSyncService;
32:
33: /**
34: * Runs the sufficient funds sync service.
35: *
36: * @param jobName the name of the job this step is being run as part of
37: * @return true if the job completed successfully, false if otherwise
38: * @see org.kuali.kfs.batch.Step#execute(java.lang.String)
39: */
40: public boolean execute(String jobName) {
41: sufficientFundsSyncService.syncSufficientFunds();
42: return true;
43: }
44:
45: /**
46: * Sets the sufficientFundsSyncService, allowing the injection of an implementation of that service
47: *
48: * @param sufficientFundsSyncService an implementation sufficientFundsSyncService to set
49: * @see org.kuali.module.gl.service.SufficientFundsSyncService
50: */
51: public void setSufficientFundsSyncService(
52: SufficientFundsSyncService sfss) {
53: sufficientFundsSyncService = sfss;
54: }
55: }
|