String schedulerName = legacy.getName();
for (LegacyJobImpl job : jobs) {
LOG.trace("Storing job from legacy store to new store: {}", job);
KahaAddScheduledJobCommand newJob = new KahaAddScheduledJobCommand();
newJob.setScheduler(schedulerName);
newJob.setJobId(job.getJobId());
newJob.setStartTime(job.getStartTime());
newJob.setCronEntry(job.getCronEntry());
newJob.setDelay(job.getDelay());
newJob.setPeriod(job.getPeriod());
newJob.setRepeat(job.getRepeat());
newJob.setNextExecutionTime(job.getNextExecutionTime());
newJob.setPayload(job.getPayload());
target.store(newJob);
}
}