use of org.opennms.web.svclayer.model.TriggerDescription in project opennms by OpenNMS.
the class ManageReportScheduleController method listTriggers.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView listTriggers(@RequestParam(value = "p", required = false, defaultValue = "0") int page, ModelAndView modelAndView) {
List<TriggerDescription> reportTriggers = m_reportSchedulerService.getTriggerDescriptions();
PagedListHolder<TriggerDescription> pagedListHolder = new PagedListHolder<>(reportTriggers);
pagedListHolder.setPageSize(m_pageSize);
// strip minus values
pagedListHolder.setPage(Math.max(page, 0));
modelAndView.addObject("pagedListHolder", pagedListHolder);
modelAndView.addObject("command", new ManageReportScheduleCommand());
modelAndView.setViewName("/report/database/manageSchedule");
return modelAndView;
}
use of org.opennms.web.svclayer.model.TriggerDescription in project opennms by OpenNMS.
the class DefaultSchedulerService method getTriggerDescriptions.
/**
* <p>getTriggerDescriptions</p>
*
* @return a {@link java.util.List} object.
*/
@Override
public List<TriggerDescription> getTriggerDescriptions() {
List<TriggerDescription> triggerDescriptions = new ArrayList<>();
try {
Set<TriggerKey> triggerKeys = m_scheduler.getTriggerKeys(GroupMatcher.<TriggerKey>groupEquals(m_triggerGroup));
for (TriggerKey triggerKey : triggerKeys) {
TriggerDescription description = new TriggerDescription();
Trigger trigger = m_scheduler.getTrigger(triggerKey);
description.setNextFireTime(trigger.getNextFireTime());
description.setTriggerName(triggerKey.getName());
description.setReportId((String) trigger.getJobDataMap().get("reportId"));
description.setDeliveryOptions((DeliveryOptions) trigger.getJobDataMap().get("deliveryOptions"));
description.setReportParameters(((ReportParameters) trigger.getJobDataMap().get("criteria")).getReportParms());
triggerDescriptions.add(description);
}
} catch (SchedulerException e) {
LOG.error("exception lretrieving trigger descriptions", e);
}
return triggerDescriptions;
}
Aggregations