use of com.vip.saturn.job.console.vo.GetJobConfigVo in project Saturn by vipshop.
the class JobServiceImpl method getJobConfigVo.
@Override
public GetJobConfigVo getJobConfigVo(String namespace, String jobName) throws SaturnJobConsoleException {
JobConfig4DB jobConfig4DB = currentJobConfigService.findConfigByNamespaceAndJobName(namespace, jobName);
if (jobConfig4DB == null) {
throw new SaturnJobConsoleException(ERROR_CODE_NOT_EXISTED, String.format("该作业(%s)不存在", jobName));
}
GetJobConfigVo getJobConfigVo = new GetJobConfigVo();
JobConfig jobConfig = new JobConfig();
SaturnBeanUtils.copyProperties(jobConfig4DB, jobConfig);
jobConfig.setDefaultValues();
getJobConfigVo.copyFrom(jobConfig);
getJobConfigVo.setTimeZonesProvided(Arrays.asList(TimeZone.getAvailableIDs()));
getJobConfigVo.setPreferListProvided(getCandidateExecutors(namespace, jobName));
getJobConfigVo.setUpStreamProvided(getCandidateUpStream(namespace, jobConfig));
getJobConfigVo.setDownStreamProvided(getCandidateDownStream(namespace, jobConfig));
CuratorRepository.CuratorFrameworkOp curatorFrameworkOp = registryCenterService.getCuratorFrameworkOp(namespace);
getJobConfigVo.setStatus(getJobStatus(getJobConfigVo.getJobName(), curatorFrameworkOp, getJobConfigVo.getEnabled()));
return getJobConfigVo;
}
Aggregations