1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.batch;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.apache.log4j.Logger;
20 import org.kuali.hr.time.calendar.CalendarEntries;
21 import org.kuali.hr.time.clocklog.ClockLog;
22 import org.kuali.hr.time.service.base.TkServiceLocator;
23 import org.kuali.hr.time.util.TkConstants;
24
25 import java.util.List;
26
27 public class PayPeriodEndBatchJob extends BatchJob {
28 private Logger LOG = Logger.getLogger(PayPeriodEndBatchJob.class);
29 private CalendarEntries calendarEntry;
30
31 public PayPeriodEndBatchJob(CalendarEntries calendarEntry) {
32 this.setBatchJobName(TkConstants.BATCH_JOB_NAMES.PAY_PERIOD_END);
33 this.setHrPyCalendarEntryId(calendarEntry.getHrCalendarEntriesId());
34 this.calendarEntry = calendarEntry;
35 }
36
37 @Override
38 public void doWork() {
39 List<ClockLog> lstOpenClockLogs = TkServiceLocator.getClockLogService().getOpenClockLogs(calendarEntry);
40 for(ClockLog cl : lstOpenClockLogs){
41 populateBatchJobEntry(cl);
42 }
43
44 }
45
46
47 @Override
48 protected void populateBatchJobEntry(Object o) {
49 ClockLog cl = (ClockLog)o;
50 String ip = this.getNextIpAddressInCluster();
51 if(StringUtils.isNotBlank(ip)){
52
53
54
55
56 } else {
57 LOG.info("No ip found in cluster to assign batch jobs");
58 }
59 }
60
61 }