1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.ole.module.purap.batch;
17  
18  import org.kuali.ole.module.purap.service.PdpExtractService;
19  import org.kuali.ole.sys.batch.AbstractStep;
20  import org.kuali.rice.core.api.datetime.DateTimeService;
21  import org.springframework.transaction.annotation.Transactional;
22  
23  import java.util.Date;
24  
25  @Transactional
26  public class ExtractPdpImmediatesStep extends AbstractStep {
27      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ExtractPdpImmediatesStep.class);
28  
29      private PdpExtractService pdpExtractService;
30      private DateTimeService dateTimeService;
31  
32      public ExtractPdpImmediatesStep() {
33          super();
34      }
35  
36      
37  
38  
39      @Override
40      public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
41          LOG.debug("execute() started");
42          pdpExtractService.extractImmediatePaymentsOnly();
43          return true;
44      }
45  
46      public boolean execute() throws InterruptedException {
47          try {
48              return execute(null, dateTimeService.getCurrentDate());
49          } catch (InterruptedException e) {
50              LOG.error("Exception occured executing step", e);
51              throw e;
52          } catch (RuntimeException e) {
53              LOG.error("Exception occured executing step", e);
54              throw e;
55          }
56      }
57  
58      public void setPdpExtractService(PdpExtractService pdpExtractService) {
59          this.pdpExtractService = pdpExtractService;
60      }
61  
62      @Override
63      public void setDateTimeService(DateTimeService dateTimeService) {
64          this.dateTimeService = dateTimeService;
65      }
66  }