/** * Ajout dans le Scheduler d'un notification */ protected void addCron(Cron cron) throws Exception { CronTrigger cronTrigger = new CronTrigger(cron.getLabel(), Scheduler.DEFAULT_GROUP, cron.getLabel(), Scheduler.DEFAULT_GROUP, cron.getDateStart(), cron.getDateEnd(), cron.getExpression()); JobDetail jobDetail = new JobDetail(cron.getLabel(), Scheduler.DEFAULT_GROUP, NotifierJob.class); JobDataMap jobDataMap = new JobDataMap(); jobDataMap.put("cronTopiaId", cron.getTopiaId()); jobDetail.setJobDataMap(jobDataMap); scheduler.scheduleJob(jobDetail, cronTrigger); log.info("Added cron : " + cron.getLabel()); }
/** * Ajout dans le Scheduler d'un notification */ protected void addCron(Cron cron) throws Exception { CronTrigger cronTrigger = new CronTrigger(cron.getLabel(), Scheduler.DEFAULT_GROUP, cron.getLabel(), Scheduler.DEFAULT_GROUP, cron.getDateStart(), cron.getDateEnd(), cron.getExpression()); JobDetail jobDetail = new JobDetail(cron.getLabel(), Scheduler.DEFAULT_GROUP, NotifierJob.class); JobDataMap jobDataMap = new JobDataMap(); jobDataMap.put("cronTopiaId", cron.getTopiaId()); jobDetail.setJobDataMap(jobDataMap); scheduler.scheduleJob(jobDetail, cronTrigger); log.info("Added cron : " + cron.getLabel()); }
newCron.setDateStart(cron.getDateStart()); newCron.setEnable(cron.getEnable()); newCron.setLabel(label);
newCron.setDateStart(cron.getDateStart()); newCron.setEnable(cron.getEnable()); newCron.setLabel(label);