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 org.kuali.ole.gl.report.CollectorReportData;
19  import org.kuali.ole.gl.service.ScrubberService;
20  import org.kuali.ole.gl.service.impl.ScrubberStatus;
21  import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
22  import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
23  
24  /**
25   * A step to run the scrubber process.
26   */
27  public class CollectorScrubberStep extends AbstractWrappedBatchStep {
28      public static final String STEP_NAME = "collectorScrubberStep";
29      private ScrubberStatus scrubberStatus;
30      private CollectorBatch batch;
31      private CollectorReportData collectorReportData;
32      private ScrubberService scrubberService;
33  
34      @Override
35      protected CustomBatchExecutor getCustomBatchExecutor() {
36          return new CustomBatchExecutor() {
37              public boolean execute() {
38                  scrubberService.scrubCollectorBatch(scrubberStatus, batch, collectorReportData);
39                  return true;
40              }
41          };
42      }
43      
44      public void setScrubberStatus(ScrubberStatus scrubberStatus) {
45          this.scrubberStatus = scrubberStatus;
46      }
47      public void setBatch(CollectorBatch batch) {
48          this.batch = batch;
49      }
50      public void setCollectorReportData(CollectorReportData collectorReportData) {
51          this.collectorReportData = collectorReportData;
52      }
53      public void setScrubberService(ScrubberService scrubberService) {
54          this.scrubberService = scrubberService;
55      }
56  }