use of org.quartz.TriggerKey in project cachecloud by sohutv.
the class TriggerController method pauseTrigger.
@RequestMapping(value = "/pause/{appId}/{type}/{host}/{port}")
public void pauseTrigger(@PathVariable long appId, @PathVariable int type, @PathVariable String host, @PathVariable int port) {
Assert.isTrue(appId > 0);
Assert.isTrue(type > 0);
Assert.hasText(host);
Assert.isTrue(port > 0);
String triggerName = ObjectConvert.linkIpAndPort(host, port);
String triggerGroup = "";
if (type == ConstUtils.CACHE_TYPE_REDIS_CLUSTER) {
triggerGroup = ConstUtils.REDIS_TRIGGER_GROUP + appId;
}
TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
try {
scheduler.pauseTrigger(triggerKey);
} catch (SchedulerException e) {
logger.error(e.getMessage(), e);
}
logger.info("trigger with name: {}, group: {} is paused", port, host);
}
use of org.quartz.TriggerKey in project cachecloud by sohutv.
the class SchedulerCenterTest method testSchedule.
@Test
public void testSchedule() {
TriggerKey key = TriggerKey.triggerKey("appInfoAlertTrigger", "appAlert");
Trigger trigger = schedulerCenter.getTrigger(key);
if (trigger != null) {
boolean isSchedule = schedulerCenter.unscheduleJob(key);
logger.warn("isSchedule={}", isSchedule);
}
// try {
// TimeUnit.SECONDS.sleep(5);
// } catch (InterruptedException e) {
// logger.error("{}", e);
// }
}
use of org.quartz.TriggerKey in project new-cloud by xie-summer.
the class QuartzManageController method remove.
@RequestMapping(value = "/remove")
public String remove(HttpServletRequest request, HttpServletResponse response, Model model) {
String name = request.getParameter("name");
String group = request.getParameter("group");
if (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(group)) {
schedulerCenter.unscheduleJob(new TriggerKey(name, group));
}
return "redirect:/manage/quartz/list";
}
use of org.quartz.TriggerKey in project new-cloud by xie-summer.
the class QuartzManageController method pause.
@RequestMapping(value = "/pause")
public String pause(HttpServletRequest request, HttpServletResponse response, Model model) {
String name = request.getParameter("name");
String group = request.getParameter("group");
if (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(group)) {
schedulerCenter.pauseTrigger(new TriggerKey(name, group));
}
return "redirect:/manage/quartz/list";
}
use of org.quartz.TriggerKey in project new-cloud by xie-summer.
the class QuartzManageController method resume.
@RequestMapping(value = "/resume")
public String resume(HttpServletRequest request, HttpServletResponse response, Model model) {
String name = request.getParameter("name");
String group = request.getParameter("group");
if (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(group)) {
schedulerCenter.resumeTrigger(new TriggerKey(name, group));
}
return "redirect:/manage/quartz/list";
}
Aggregations