View Javadoc
1   /*
2    * Copyright 2005-2009 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.document.service.CorrectionDocumentService;
21  import org.kuali.ole.gl.service.ScrubberService;
22  import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
23  import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
24  
25  /**
26   * A step to run the scrubber process.
27   */
28  public class CorrectionProcessScrubberStep extends AbstractWrappedBatchStep {
29      public static final String STEP_NAME = "correctionProcessScrubberStep";
30      private String documentId;
31      private CorrectionDocumentService correctionDocumentService;
32      private ScrubberService scrubberService;
33  
34      /**
35       * @see org.kuali.ole.sys.batch.AbstractStep#getRequiredDirectoryNames()
36       */
37      @Override
38      public List<String> getRequiredDirectoryNames() {
39          return correctionDocumentService.getRequiredDirectoryNames();
40      }
41  
42      @Override
43      protected CustomBatchExecutor getCustomBatchExecutor() {
44          return new CustomBatchExecutor() {
45              public boolean execute() {
46                  scrubberService.scrubGroupReportOnly(correctionDocumentService.generateOutputOriginEntryFileName(documentId), documentId);
47                  return true;
48              }
49          };
50      }
51      
52      public void setDocumentId(String documentId) {
53          this.documentId = documentId;
54      }
55  
56      public void setCorrectionDocumentService(CorrectionDocumentService correctionDocumentService) {
57          this.correctionDocumentService = correctionDocumentService;
58      }
59  
60      public void setScrubberService(ScrubberService scrubberService) {
61          this.scrubberService = scrubberService;
62      }
63  }