/** * Suppression d'une notification */ public void del(Cron cron) { try { boolean result = scheduler.deleteJob(cron.getLabel(), Scheduler.DEFAULT_GROUP); if (result) { log.info("Deleted cron : " + cron.getLabel()); } else { log.info("Failed delete cron : " + cron.getLabel()); } } catch (Exception e) { log.error("Deleting failed", e); } }
/** * Suppression d'une notification */ public void del(Cron cron) { try { boolean result = scheduler.deleteJob(cron.getLabel(), Scheduler.DEFAULT_GROUP); if (result) { log.info("Deleted cron : " + cron.getLabel()); } else { log.info("Failed delete cron : " + cron.getLabel()); } } catch (Exception e) { log.error("Deleting failed", e); } }
/** * 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()); }
String label = cron.getLabel(); if (topiaId == null || "".equals(topiaId)) { if (cronDAO.findByLabel(label) != null) { } else { newCron = cronDAO.findByTopiaId(topiaId); if (!newCron.getLabel().equals(label) && cronDAO.findByLabel(label) != null) { throw new LogicException("error.service.cron.already.exists");
String label = cron.getLabel(); if (topiaId == null || "".equals(topiaId)) { if (cronDAO.findByLabel(label) != null) { } else { newCron = cronDAO.findByTopiaId(topiaId); if (!newCron.getLabel().equals(label) && cronDAO.findByLabel(label) != null) { throw new LogicException("error.service.cron.already.exists");