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.gl.batch;
17  
18  import java.util.List;
19  
20  import org.kuali.ole.gl.batch.service.EnterpriseFeederService;
21  import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
22  import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
23  
24  /**
25   * This step executes the enterprise feeder
26   */
27  public class EnterpriseFeedStep extends AbstractWrappedBatchStep {
28  
29      private EnterpriseFeederService enterpriseFeederService;
30  
31      /**
32       * @see org.kuali.ole.sys.batch.AbstractStep#getRequiredDirectoryNames()
33       */
34      @Override
35      public List<String> getRequiredDirectoryNames() {
36          return enterpriseFeederService.getRequiredDirectoryNames();
37      }
38  
39      @Override
40      protected CustomBatchExecutor getCustomBatchExecutor() {
41          return new CustomBatchExecutor() {
42              public boolean execute() {
43                  enterpriseFeederService.feed("enterpriseFeedJob", true);
44                  return true;
45              }
46          };
47      }
48  
49      /**
50       * Sets the enterpriseFeederService attribute value.
51       * 
52       * @param enterpriseFeederService The enterpriseFeederService to set.
53       * @see org.kuali.ole.gl.batch.service.EnterpriseFeederService
54       */
55      public void setEnterpriseFeederService(EnterpriseFeederService enterpriseFeederService) {
56          this.enterpriseFeederService = enterpriseFeederService;
57      }
58  
59  }