1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.batch;
17
18 import java.io.File;
19 import java.util.Date;
20
21 import org.kuali.ole.gl.GeneralLedgerConstants;
22 import org.kuali.ole.sys.batch.AbstractStep;
23 import org.springframework.util.StopWatch;
24
25
26
27
28 public class IcrSortStep extends AbstractStep {
29 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(IcrSortStep.class);
30 private String batchFileDirectoryName;
31
32
33
34
35
36
37
38
39 @Override
40 public boolean execute(String jobName, Date jobRunDate) {
41 StopWatch stopWatch = new StopWatch();
42 stopWatch.start(jobName);
43 String inputFile = batchFileDirectoryName + File.separator + GeneralLedgerConstants.BatchFileSystem.ICR_TRANSACTIONS_OUTPUT_FILE + GeneralLedgerConstants.BatchFileSystem.EXTENSION;
44 String outputFile = batchFileDirectoryName + File.separator + GeneralLedgerConstants.BatchFileSystem.ICR_POSTER_INPUT_FILE + GeneralLedgerConstants.BatchFileSystem.EXTENSION;
45
46 BatchSortUtil.sortTextFileWithFields(inputFile, outputFile, new PosterSortComparator());
47
48 stopWatch.stop();
49 if (LOG.isDebugEnabled()) {
50 LOG.debug("IcrSort step of " + jobName + " took " + (stopWatch.getTotalTimeSeconds() / 60.0) + " minutes to complete");
51 }
52 return true;
53 }
54
55 public void setBatchFileDirectoryName(String batchFileDirectoryName) {
56 this.batchFileDirectoryName = batchFileDirectoryName;
57 }
58
59 }