private List<EnvironmentReferenceModel> processEnvironmentReference(GraphContext context, Element element) { EnvironmentReferenceService environmentReferenceService = new EnvironmentReferenceService(context); List<EnvironmentReferenceModel> resources = new LinkedList<EnvironmentReferenceModel>(); // find JMS references... List<Element> queueReferences = $(element).find("resource-env-ref").get(); for (Element e : queueReferences) { String type = $(e).child("resource-env-ref-type").text(); String name = $(e).child("resource-env-ref-name").text(); type = StringUtils.trim(type); name = StringUtils.trim(name); EnvironmentReferenceModel ref = environmentReferenceService.findEnvironmentReference(name, type); if (ref == null) { ref = environmentReferenceService.create(); ref.setName(name); ref.setReferenceType(type); } resources.add(ref); } return resources; }
private void processElement(EnvironmentReferenceService environmentReferenceService, List<EnvironmentReferenceModel> resources, Element element, String typeLocation, String nameLocation, EnvironmentReferenceTagType refType) { String id = $(element).attr("id"); String type = $(element).child(typeLocation).text(); String name = $(element).child(nameLocation).text(); type = StringUtils.trim(type); name = StringUtils.trim(name); EnvironmentReferenceModel ref = environmentReferenceService.findEnvironmentReference(name, refType); if (ref == null) { ref = environmentReferenceService.create(); ref.setName(name); ref.setReferenceType(type); ref.setReferenceTagType(refType); LOG.info("Added: "+ref); } else { if(ref.getReferenceTagType() != null && (ref.getReferenceTagType() != refType)) { LOG.warning("Expected type: "+EnvironmentReferenceTagType.RESOURCE_REF +" but actually: "+ref.getReferenceType()); } } ref.setReferenceId(id); resources.add(ref); }
private void processElement(EnvironmentReferenceService environmentReferenceService, List<EnvironmentReferenceModel> resources, Element element, String typeLocation, String nameLocation, EnvironmentReferenceTagType refType) { String id = $(element).attr("id"); String type = $(element).child(typeLocation).text(); String name = $(element).child(nameLocation).text(); type = StringUtils.trim(type); name = StringUtils.trim(name); EnvironmentReferenceModel ref = environmentReferenceService.findEnvironmentReference(name, refType); if (ref == null) { ref = environmentReferenceService.create(); ref.setName(name); ref.setReferenceType(type); ref.setReferenceTagType(refType); LOG.info("Added: "+ref); } else { if(ref.getReferenceTagType() != null && (ref.getReferenceTagType() != refType)) { LOG.warning("Expected type: "+EnvironmentReferenceTagType.RESOURCE_REF +" but actually: "+ref.getReferenceType()); } } ref.setReferenceId(id); resources.add(ref); }
private List<EnvironmentReferenceModel> processEnvironmentReference(GraphContext context, Element element) { EnvironmentReferenceService environmentReferenceService = new EnvironmentReferenceService(context); List<EnvironmentReferenceModel> resources = new ArrayList<>(); // find JMS references... List<Element> queueReferences = $(element).find("resource-ref").get(); for (Element e : queueReferences) { String id = $(e).attr("id"); String type = $(e).child("res-type").text(); String name = $(e).child("res-ref-name").text(); type = StringUtils.trim(type); name = StringUtils.trim(name); EnvironmentReferenceModel ref = environmentReferenceService.findEnvironmentReference(name, type); if (ref == null) { ref = environmentReferenceService.create(); ref.setName(name); ref.setReferenceType(type); } ref.setReferenceId(id); resources.add(ref); } return resources; } }
if (ref == null) ref = environmentReferenceService.create(); ref.setName(name); ref.setReferenceId(id); if (ref == null) ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name); if (ref == null) ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name); if (ref == null) ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name); ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name);
if (ref == null) ref = environmentReferenceService.create(); ref.setName(name); ref.setReferenceId(id); if (ref == null) ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name); if (ref == null) ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name); if (ref == null) ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name); ref = environmentReferenceService.create(); ref.setReferenceId(id); ref.setName(name);