use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ContainerController method getContainerToken.
@RequestMapping(value = "getContainerToken", method = RequestMethod.GET)
public RequestResult getContainerToken(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
Object containerToken = containerService.getContainerToken();
requestResult.setSuccess(true);
requestResult.setObj(containerToken);
} catch (SaturnJobConsoleException e) {
requestResult.setSuccess(false);
requestResult.setMessage(e.getMessage());
} catch (Throwable t) {
requestResult.setSuccess(false);
requestResult.setMessage(t.toString());
}
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ContainerController method updateContainerInstances.
@RequestMapping(value = "/updateContainerInstances", method = RequestMethod.POST)
public RequestResult updateContainerInstances(String taskId, Integer instances, HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
if (taskId == null) {
throw new SaturnJobConsoleException("The taskId cannot be null");
}
if (instances == null || instances < 0) {
throw new SaturnJobConsoleException("Please input the positive instances");
}
containerService.updateContainerInstances(taskId, instances);
requestResult.setSuccess(true);
} catch (SaturnJobConsoleException e) {
requestResult.setSuccess(false);
requestResult.setMessage(e.getMessage());
} catch (Throwable t) {
requestResult.setSuccess(false);
requestResult.setMessage(t.toString());
}
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ContainerController method getContainerVos.
@RequestMapping(value = "/getContainerVos", method = RequestMethod.GET)
public RequestResult getContainerVos(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
List<ContainerVo> containerVos = containerService.getContainerVos();
requestResult.setSuccess(true);
requestResult.setObj(containerVos);
} catch (SaturnJobConsoleException e) {
requestResult.setSuccess(false);
requestResult.setMessage(e.getMessage());
} catch (Throwable t) {
requestResult.setSuccess(false);
requestResult.setMessage(t.toString());
}
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class DashboardRefreshController method dashboardRefresh.
@RequestMapping(value = "dashboardRefresh", method = RequestMethod.POST)
@ResponseBody
public RequestResult dashboardRefresh(String zkClusterKey, HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
long beforeRefresh = System.currentTimeMillis();
doDashboardRefresh(zkClusterKey);
long afterRefresh = System.currentTimeMillis();
long takeTime = afterRefresh - beforeRefresh;
requestResult.setSuccess(true);
requestResult.setObj(takeTime);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
requestResult.setSuccess(false);
requestResult.setMessage(e.toString());
}
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class JobConfigController method load.
@RequestMapping(value = "jobconfig/getExportRegList", method = RequestMethod.GET)
@ResponseBody
public RequestResult load(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
List<RegistryCenterConfiguration> regCenterConfList = jobConfigInitializationService.getRegistryCenterConfigurations();
requestResult.setSuccess(true);
requestResult.setObj(regCenterConfList);
} catch (Throwable t) {
LOGGER.error(t.getMessage(), t);
requestResult.setSuccess(false);
requestResult.setMessage(t.toString());
}
return requestResult;
}
Aggregations