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.ole.sys.util.KfsDateUtils;
21 import org.kuali.rice.core.api.datetime.DateTimeService;
22
23 import java.util.Date;
24
25 public class ExtractPdpStep extends AbstractStep {
26 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ExtractPdpStep.class);
27
28 private PdpExtractService pdpExtractService;
29 private DateTimeService dateTimeService;
30
31 public ExtractPdpStep() {
32 super();
33 }
34
35
36
37
38 public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
39 LOG.debug("execute() started");
40
41 pdpExtractService.extractPayments(KfsDateUtils.convertToSqlDate(jobRunDate));
42 return true;
43 }
44
45 public boolean execute() throws InterruptedException {
46 try {
47 return execute(null, dateTimeService.getCurrentDate());
48 } catch (InterruptedException e) {
49 LOG.error("Exception occured executing step", e);
50 throw e;
51 } catch (RuntimeException e) {
52 LOG.error("Exception occured executing step", e);
53 throw e;
54 }
55 }
56
57 public void setPdpExtractService(PdpExtractService pdpExtractService) {
58 this.pdpExtractService = pdpExtractService;
59 }
60
61 public void setDateTimeService(DateTimeService dateTimeService) {
62 this.dateTimeService = dateTimeService;
63 }
64 }