use of org.quartz.TriggerKey in project cachecloud by sohutv.
the class RedisCenterImpl method unDeployRedisSlowLogCollection.
@Override
public boolean unDeployRedisSlowLogCollection(long appId, String host, int port) {
Assert.isTrue(appId > 0);
Assert.hasText(host);
Assert.isTrue(port > 0);
TriggerKey triggerKey = TriggerKey.triggerKey(ObjectConvert.linkIpAndPort(host, port), ConstUtils.REDIS_SLOWLOG_TRIGGER_GROUP + appId);
Trigger trigger = schedulerCenter.getTrigger(triggerKey);
if (trigger == null) {
return true;
}
return schedulerCenter.unscheduleJob(triggerKey);
}
use of org.quartz.TriggerKey in project cachecloud by sohutv.
the class MachineCenterImpl method deployServerCollection.
@Override
public boolean deployServerCollection(long hostId, String ip) {
Assert.hasText(ip);
Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put(ConstUtils.HOST_KEY, ip);
JobKey jobKey = JobKey.jobKey(ConstUtils.SERVER_JOB_NAME, ConstUtils.SERVER_JOB_GROUP);
TriggerKey triggerKey = TriggerKey.triggerKey(ip, ConstUtils.SERVER_TRIGGER_GROUP + ip);
boolean result = schedulerCenter.deployJobByCron(jobKey, triggerKey, dataMap, ScheduleUtil.getFiveMinuteCronByHostId(hostId), false);
return result;
}
use of org.quartz.TriggerKey in project cachecloud by sohutv.
the class MachineCenterImpl method unDeployMachineMonitor.
@Override
public boolean unDeployMachineMonitor(long hostId, String ip) {
Assert.isTrue(hostId > 0);
Assert.hasText(ip);
TriggerKey monitorTriggerKey = TriggerKey.triggerKey(ip, ConstUtils.MACHINE_MONITOR_TRIGGER_GROUP + hostId);
Trigger trigger = schedulerCenter.getTrigger(monitorTriggerKey);
if (trigger == null) {
return true;
}
return schedulerCenter.unscheduleJob(monitorTriggerKey);
}
use of org.quartz.TriggerKey in project cachecloud by sohutv.
the class MachineCenterImpl method deployMachineCollection.
/**
* 为当前机器收集信息创建trigger并部署
*
* @param hostId 机器id
* @param ip ip
* @return 部署成功返回true,否则返回false
*/
@Override
public boolean deployMachineCollection(final long hostId, final String ip) {
Assert.isTrue(hostId > 0);
Assert.hasText(ip);
Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put(ConstUtils.HOST_KEY, ip);
dataMap.put(ConstUtils.HOST_ID_KEY, hostId);
JobKey jobKey = JobKey.jobKey(ConstUtils.MACHINE_JOB_NAME, ConstUtils.MACHINE_JOB_GROUP);
TriggerKey triggerKey = TriggerKey.triggerKey(ip, ConstUtils.MACHINE_TRIGGER_GROUP + hostId);
boolean result = schedulerCenter.deployJobByCron(jobKey, triggerKey, dataMap, ScheduleUtil.getMachineStatsCron(hostId), false);
return result;
}
use of org.quartz.TriggerKey in project cachecloud by sohutv.
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";
}
Aggregations