profileResource.save();
gatewayProfile.setGatewayID(profileResource.getGatewayID());
List<ComputeResourcePreference> computeResourcePreferences = gatewayProfile.getComputeResourcePreferences();
if (computeResourcePreferences != null && !computeResourcePreferences.isEmpty()){
for (ComputeResourcePreference preference : computeResourcePreferences ){
ComputeHostPreferenceResource resource = new ComputeHostPreferenceResource();
resource.setGatewayProfile(profileResource);
resource.setResourceId(preference.getComputeResourceId());
ComputeResourceResource computeHostResource = new ComputeResourceResource();
resource.setComputeHostResource((ComputeResourceResource)computeHostResource.get(preference.getComputeResourceId()));
resource.setGatewayId(profileResource.getGatewayID());
resource.setOverrideByAiravata(preference.isOverridebyAiravata());
resource.setPreferredJobProtocol(preference.getPreferredJobSubmissionProtocol());
resource.setPreferedDMProtocol(preference.getPreferredDataMovementProtocol());
resource.setBatchQueue(preference.getPreferredBatchQueue());
resource.setProjectNumber(preference.getAllocationProjectNumber());
resource.setScratchLocation(preference.getScratchLocation());
resource.save();
}
}
return profileResource.getGatewayID();
}catch (Exception e) {
logger.error("Error while saving gateway profile...", e);