View Javadoc
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 java.util.Date;
19  
20  import org.kuali.ole.gl.batch.service.SufficientFundsFullRebuildService;
21  import org.kuali.ole.sys.batch.AbstractStep;
22  import org.kuali.ole.sys.batch.TestingStep;
23  
24  /**
25   * 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 -
26   * as Account, Chart, and Object Code records, when saved, will populate the sufficient funds tables, making this task redundant.
27   * However, if that information has not been built, this job will generate that information.
28   */
29  public class SufficientFundsFullRebuildStep extends AbstractStep implements TestingStep {
30      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(SufficientFundsFullRebuildStep.class);
31      private SufficientFundsFullRebuildService sufficientFundsFullRebuildService;
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       * @param jobRunDate the time/date the job was started
38       * @return true if the job completed successfully, false if otherwise
39       * @see org.kuali.ole.sys.batch.Step#execute(String, Date)
40       */
41      public boolean execute(String jobName, Date jobRunDate) {
42          sufficientFundsFullRebuildService.syncSufficientFunds();
43          return true;
44      }
45  
46      /**
47       * Sets the sufficientFundsFullRebuildService, allowing the injection of an implementation of that service
48       * 
49       * @param sufficientFundsFullRebuildService an implementation sufficientFundsFullRebuildService to set
50       * @see org.kuali.ole.gl.batch.service.SufficientFundsFullRebuildService
51       */
52      public void setSufficientFundsFullRebuildService(SufficientFundsFullRebuildService sfss) {
53          sufficientFundsFullRebuildService = sfss;
54      }
55  }