Search in sources :

Example 1 with UpdateJobConfigException

use of com.vip.saturn.job.integrate.exception.UpdateJobConfigException in project Saturn by vipshop.

the class UpdateJobConfigServiceImpl method batchUpdatePreferList.

@Override
public void batchUpdatePreferList(List<JobConfigInfo> jobConfigInfos) throws UpdateJobConfigException {
    if (CollectionUtils.isEmpty(jobConfigInfos)) {
        return;
    }
    List<JobConfig4DB> currentJobConfigs = new ArrayList<JobConfig4DB>();
    JobConfig4DB currentJobConfig = null;
    for (JobConfigInfo jobConfigInfo : jobConfigInfos) {
        currentJobConfig = new JobConfig4DB();
        currentJobConfig.setNamespace(jobConfigInfo.getNamespace());
        currentJobConfig.setJobName(jobConfigInfo.getJobName());
        currentJobConfig.setPreferList(jobConfigInfo.getPerferList());
        currentJobConfigs.add(currentJobConfig);
    }
    try {
        currentJobConfigService.batchUpdatePreferList(currentJobConfigs);
    } catch (SaturnJobConsoleException e) {
        throw new UpdateJobConfigException(e);
    }
}
Also used : UpdateJobConfigException(com.vip.saturn.job.integrate.exception.UpdateJobConfigException) JobConfigInfo(com.vip.saturn.job.integrate.entity.JobConfigInfo) SaturnJobConsoleException(com.vip.saturn.job.console.exception.SaturnJobConsoleException) ArrayList(java.util.ArrayList) JobConfig4DB(com.vip.saturn.job.console.mybatis.entity.JobConfig4DB)

Aggregations

SaturnJobConsoleException (com.vip.saturn.job.console.exception.SaturnJobConsoleException)1 JobConfig4DB (com.vip.saturn.job.console.mybatis.entity.JobConfig4DB)1 JobConfigInfo (com.vip.saturn.job.integrate.entity.JobConfigInfo)1 UpdateJobConfigException (com.vip.saturn.job.integrate.exception.UpdateJobConfigException)1 ArrayList (java.util.ArrayList)1