1 /*
2 * Copyright 2006 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
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.ole.gl.batch;
17
18 import org.kuali.ole.gl.batch.service.SufficientFundsAccountUpdateService;
19 import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
20 import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
21
22 /**
23 * A step to run the process that rebuilds information that supports sufficient funds inquiries
24 */
25 public class SufficientFundsAccountUpdateStep extends AbstractWrappedBatchStep {
26 private SufficientFundsAccountUpdateService sufficientFundsAccountUpdateService;
27
28 /**
29 * Return a proper batch executor
30 * @see org.kuali.ole.sys.batch.AbstractWrappedBatchStep#getCustomBatchExecutor()
31 */
32 @Override
33 protected CustomBatchExecutor getCustomBatchExecutor() {
34 return new CustomBatchExecutor() {
35 /**
36 * Runs the sufficient funds rebuilder step.
37 *
38 * @return true if the job completed successfully, false if otherwise
39 * @see org.kuali.ole.sys.batch.Step#execute(java.lang.String)
40 */
41 public boolean execute() {
42 sufficientFundsAccountUpdateService.rebuildSufficientFunds();
43 return true;
44 }
45 };
46 }
47
48
49 /**
50 * Sets the sufficientFundsAccountUpdateService, allowing the injection of an implementation of that service
51 *
52 * @param sufficientFundsAccountUpdateService an implementation sufficientFundsAccountUpdateService to set
53 * @see org.kuali.ole.gl.batch.service.SufficientFundsAccountUpdateService
54 */
55 public void setSufficientFundsAccountUpdateService(SufficientFundsAccountUpdateService sfrs) {
56 sufficientFundsAccountUpdateService = sfrs;
57 }
58 }