use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class NamespaceZkClusterMappingController method moveNamespaceBatch.
@RequestMapping(value = "moveNamespaceBatch", method = RequestMethod.POST)
public RequestResult moveNamespaceBatch(HttpServletRequest request, String namespaces, String zkClusterKeyNew, boolean updateDBOnly) {
RequestResult requestResult = new RequestResult();
try {
if (namespaces == null || namespaces.trim().isEmpty()) {
throw new SaturnJobConsoleException("The namespace cannot be null");
}
if (zkClusterKeyNew == null || zkClusterKeyNew.trim().isEmpty()) {
throw new SaturnJobConsoleException("The zkClusterKeyNew cannot be null");
}
namespaceZkClusterMappingService.moveNamespaceBatchTo(namespaces, zkClusterKeyNew, "", updateDBOnly);
requestResult.setSuccess(true);
} catch (SaturnJobConsoleException e) {
requestResult.setSuccess(false);
requestResult.setMessage(e.getMessage());
} catch (Throwable t) {
LOGGER.error(t.getMessage(), 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 NamespaceZkClusterMappingController method clearMoveNamespaceBatchStatus.
@RequestMapping(value = "clearMoveNamespaceBatchStatus", method = RequestMethod.POST)
public RequestResult clearMoveNamespaceBatchStatus(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
namespaceZkClusterMappingService.clearMoveNamespaceBatchStatus();
requestResult.setSuccess(true);
} catch (Throwable t) {
LOGGER.error(t.getMessage(), 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 NamespaceZkClusterMappingController method initNamespaceZkClusterMapping.
@RequestMapping(value = "initNamespaceZkClusterMapping", method = RequestMethod.POST)
public RequestResult initNamespaceZkClusterMapping(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
namespaceZkClusterMappingService.initNamespaceZkClusterMapping("");
requestResult.setSuccess(true);
} catch (SaturnJobConsoleException e) {
requestResult.setSuccess(false);
requestResult.setMessage(e.getMessage());
} catch (Throwable t) {
LOGGER.error(t.getMessage(), 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 SaturnJunkDataController method removeJunkData.
@ResponseBody
@RequestMapping(value = "removeJunkData", method = RequestMethod.POST)
public RequestResult removeJunkData(HttpServletRequest request, SaturnJunkData saturnJunkData, HttpSession session) {
RequestResult requestResult = new RequestResult();
try {
saturnJunkDataService.removeSaturnJunkData(saturnJunkData);
LOGGER.info("[removeJunkData success, saturnJunkData is {}]", saturnJunkData);
requestResult.setSuccess(true);
} catch (Throwable t) {
requestResult.setSuccess(false);
if (t instanceof SaturnJobConsoleException) {
requestResult.setMessage(t.getMessage());
} else {
requestResult.setMessage(t.toString());
}
LOGGER.error("[removeJunkData error, saturnJunkData is " + saturnJunkData + "]", t);
}
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class SaturnJunkDataController method getJunkData.
@ResponseBody
@RequestMapping(value = "getJunkdata", method = RequestMethod.GET)
public RequestResult getJunkData(HttpServletRequest request, String newZkClusterKey) {
RequestResult requestResult = new RequestResult();
try {
List<SaturnJunkData> junkData = saturnJunkDataService.getJunkData(newZkClusterKey);
requestResult.setSuccess(true);
requestResult.setObj(junkData);
} catch (Throwable t) {
requestResult.setSuccess(false);
if (t instanceof SaturnJobConsoleException) {
requestResult.setMessage(t.getMessage());
} else {
requestResult.setMessage(t.toString());
}
LOGGER.error(t.getMessage(), t);
}
return requestResult;
}
Aggregations