use of org.opennms.netmgt.config.reportd.Report in project opennms by OpenNMS.
the class ReportScheduler method buildReportSchedule.
private void buildReportSchedule() {
synchronized (m_lock) {
for (Report report : m_configDao.getReports()) {
JobDetail detail = null;
CronTriggerImpl trigger = null;
try {
detail = new JobDetailImpl(report.getReportName(), JOB_GROUP, ReportJob.class, false, false);
detail.getJobDataMap().put(ReportJob.KEY, report);
trigger = new CronTriggerImpl(report.getReportName(), JOB_GROUP, report.getCronSchedule());
trigger.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
getScheduler().scheduleJob(detail, trigger);
} catch (ParseException e) {
LOG.error("buildReportSchedule: {}", e.getMessage(), e);
} catch (SchedulerException e) {
LOG.error("buildReportSchedule: {}", e.getMessage(), e);
}
}
}
}
Aggregations