r.setResourceJobManagerType(manager.getResourceJobManagerType().toString());
return r;
}
public static ResourceJobManager getResourceJobManager(ResourceJobManagerResource manager) throws AppCatalogException{
ResourceJobManager r = new ResourceJobManager();
r.setResourceJobManagerId(manager.getResourceJobManagerId());
r.setJobManagerBinPath(manager.getJobManagerBinPath());
r.setPushMonitoringEndpoint(manager.getPushMonitoringEndpoint());
r.setResourceJobManagerType(ResourceJobManagerType.valueOf(manager.getResourceJobManagerType()));
r.setJobManagerCommands(new HashMap<JobManagerCommand, String>());
JobManagerCommandResource jmcr=new JobManagerCommandResource();
List<Resource> jmcrList = jmcr.get(AbstractResource.JobManagerCommandConstants.RESOURCE_JOB_MANAGER_ID, manager.getResourceJobManagerId());
if (jmcrList != null && !jmcrList.isEmpty()){
for (Resource rrr : jmcrList) {
JobManagerCommandResource rr=(JobManagerCommandResource)rrr;
r.getJobManagerCommands().put(JobManagerCommand.valueOf(rr.getCommandType()), rr.getCommand());
}
}
return r;
}