@RequestMapping(value = "add") public @ResponseBody Boolean deploy( String jobName, String triggerName, String jobClassName, String cronExpression, Boolean listener) { JobModel model = new JobModel(); model.setJobName(jobName); model.setTriggerName(triggerName); model.setJobClassName(jobClassName); model.setCronExpression(cronExpression); if (listener != null) { model.setListener(true); } else { model.setListener(false); } return quartzService.deploy(model); }
@RequestMapping(value = "run") public @ResponseBody Boolean startNow(String jobName, String jobGroup) { JobKey jobKey = new JobKey(jobName, jobGroup); return quartzService.startNow(jobKey); }
@RequestMapping(value = "resume") public @ResponseBody Boolean resume(String jobName, String jobGroup) { JobKey jobKey = new JobKey(jobName, jobGroup); return quartzService.resume(jobKey); }
@RequestMapping(value = "remove") public @ResponseBody Boolean unDeploy(String jobName, String jobGroup) { JobKey jobKey = new JobKey(jobName, jobGroup); return quartzService.unDeploy(jobKey); }
@RequestMapping(value = "index") public String index(Model model) { model.addAttribute("jobs", quartzService.getAllJobs()); return "index"; }