View Javadoc
1   /*
2    * Copyright 2007 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.coa.batch;
17  
18  import java.util.Date;
19  
20  import org.kuali.ole.coa.service.PriorYearAccountService;
21  import org.kuali.ole.coa.service.PriorYearOrganizationService;
22  import org.kuali.ole.sys.batch.AbstractStep;
23  
24  /**
25   * This class updates the prior year data in the prior year account and prior year org tables to set it to the new year This is
26   * typically run at year end
27   */
28  public class UpdatePriorYearDataStep extends AbstractStep {
29  
30      private PriorYearAccountService priorYearAccountService;
31      private PriorYearOrganizationService priorYearOrganizationService;
32  
33      /**
34       * Executes the table updates when
35       * 
36       * @see org.kuali.ole.sys.batch.Step#execute(String, Date)
37       */
38      public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
39          priorYearAccountService.populatePriorYearAccountsFromCurrent();
40          priorYearOrganizationService.populatePriorYearOrganizationsFromCurrent();
41          return true;
42      }
43  
44      /**
45       * Service setter for Spring injection
46       * 
47       * @param priorYearAccountService
48       */
49      public void setPriorYearAccountService(PriorYearAccountService priorYearAccountService) {
50          this.priorYearAccountService = priorYearAccountService;
51      }
52  
53      /**
54       * Service setter for Spring injection
55       * 
56       * @param priorYearOrganizationService
57       */
58      public void setPriorYearOrganizationService(PriorYearOrganizationService priorYearOrganizationService) {
59          this.priorYearOrganizationService = priorYearOrganizationService;
60      }
61  
62  }