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.service.impl;
17  
18  import org.apache.log4j.Logger;
19  import org.kuali.ole.coa.dataaccess.PriorYearOrganizationDao;
20  import org.kuali.ole.coa.service.PriorYearOrganizationService;
21  import org.springframework.transaction.annotation.Transactional;
22  
23  /**
24   * This is the default implementation of the PriorYearOrganizationService
25   */
26  @Transactional
27  public class PriorYearOrganizationServiceImpl implements PriorYearOrganizationService {
28      private static final Logger LOG = Logger.getLogger(PriorYearOrganizationServiceImpl.class);
29  
30      private PriorYearOrganizationDao priorYearOrganizationDao;
31  
32      /**
33       * Constructs a PriorYearOrganizationServiceImpl.java.
34       */
35      public PriorYearOrganizationServiceImpl() {
36          super();
37      }
38  
39      /**
40       * @see org.kuali.ole.coa.service.PriorYearOrganizationService#populatePriorYearOrganizationFromCurrent()
41       */
42      public void populatePriorYearOrganizationsFromCurrent() {
43  
44          int purgedCount = priorYearOrganizationDao.purgePriorYearOrganizations();
45          if (LOG.isInfoEnabled()) {
46              LOG.info("number of prior year organizations purged : " + purgedCount);
47          }
48  
49          int copiedCount = priorYearOrganizationDao.copyCurrentOrganizationsToPriorYearTable();
50          if (LOG.isInfoEnabled()) {
51              LOG.info("number of current year organizations copied to prior year : " + copiedCount);
52          }
53      }
54  
55      /**
56       * This method sets the local dao variable to the value provided.
57       * 
58       * @param priorYearOrganizationDao The PriorYearOrganizationDao to set.
59       */
60      public void setPriorYearOrganizationDao(PriorYearOrganizationDao priorYearOrganizationDao) {
61          this.priorYearOrganizationDao = priorYearOrganizationDao;
62      }
63  
64  }