use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ExecutorServiceImpl method shardAllAtOnce.
@Override
public RequestResult shardAllAtOnce() throws SaturnJobConsoleException {
try {
RequestResult requestResult = new RequestResult();
CuratorFrameworkOp curatorFrameworkOp = curatorRepository.inSessionClient();
String shardAllAtOnceNodePath = ExecutorNodePath.getExecutorShardingNodePath("shardAllAtOnce");
if (curatorFrameworkOp.checkExists(shardAllAtOnceNodePath)) {
curatorFrameworkOp.deleteRecursive(shardAllAtOnceNodePath);
}
curatorFrameworkOp.create(shardAllAtOnceNodePath);
requestResult.setMessage("");
requestResult.setSuccess(true);
return requestResult;
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new SaturnJobConsoleException(e);
}
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ContainerController method getTimeZoneIds.
@RequestMapping(value = "/getTimeZoneIds", method = RequestMethod.GET)
public RequestResult getTimeZoneIds(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
requestResult.setSuccess(true);
requestResult.setObj(SaturnConstants.TIME_ZONE_IDS);
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ContainerController method getRegistryRepositoryTags.
@RequestMapping(value = "/getRegistryRepositoryTags", method = RequestMethod.GET)
public RequestResult getRegistryRepositoryTags(String repository, HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
if (repository == null) {
throw new SaturnJobConsoleException("The repository cannot be null");
}
String constraints = containerService.getRegistryRepositoryTags(repository);
requestResult.setSuccess(true);
requestResult.setObj(constraints);
} 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 getRegistryCatalog.
@RequestMapping(value = "/getRegistryCatalog", method = RequestMethod.GET)
public RequestResult getRegistryCatalog(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
String registryCatalog = containerService.getRegistryCatalog();
requestResult.setSuccess(true);
requestResult.setObj(registryCatalog);
} 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 removeContainer.
@RequestMapping(value = "/removeContainer", method = RequestMethod.POST)
public RequestResult removeContainer(String taskId, HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
if (taskId == null) {
throw new SaturnJobConsoleException("The taskId cannot be null");
}
containerService.removeContainer(taskId);
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;
}
Aggregations