}
@Override
public JobModel updateJob(JobModel jobModel) throws GwtException {
JobDescriptor jd=new JobDescriptor();
jd.setCronExpression(jobModel.getCronExpression());
jd.setDependencies(jobModel.getDependencies());
jd.setDesc(jobModel.getDesc());
jd.setGroupId(jobModel.getGroupId());
jd.setId(jobModel.getId());
JobRunType type=null;
if(jobModel.getJobRunType().equals(JobModel.MapReduce)){
type=JobRunType.MapReduce;
}else if(jobModel.getJobRunType().equals(JobModel.SHELL)){
type=JobRunType.Shell;
}else if(jobModel.getJobRunType().equals(JobModel.HIVE)){
type=JobRunType.Hive;
}
jd.setJobType(type);
JobScheduleType scheduleType=null;
if(JobModel.DEPEND_JOB.equals(jobModel.getJobScheduleType())){
scheduleType=JobScheduleType.Dependent;
}else if(JobModel.INDEPEN_JOB.equals(jobModel.getJobScheduleType())){
scheduleType=JobScheduleType.Independent;
}
jd.setName(jobModel.getName());
jd.setOwner(jobModel.getOwner());
jd.setResources(jobModel.getLocalResources());
jd.setProperties(jobModel.getLocalProperties());
jd.setScheduleType(scheduleType);
jd.setScript(jobModel.getScript());
jd.setAuto(jobModel.getAuto());
jd.setPreProcessers(parseProcessers(jobModel.getPreProcessers()));
jd.setPostProcessers(parseProcessers(jobModel.getPostProcessers()));
try {
permissionGroupManager.updateJob(LoginUser.getUser().getUid(), jd);
return getUpstreamJob(jd.getId());
} catch (ZeusException e) {
log.error(e);
throw new GwtException(e.getMessage());
}
}