private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Element resourceRef, String tagName) { String href = $(resourceRef).child(tagName).attr("href"); String resourceId = StringUtils.substringAfterLast(href, "ejb-jar.xml#"); String jndiLocation = $(resourceRef).attr("jndiName"); if (StringUtils.isNotBlank(jndiLocation) && StringUtils.isNotBlank(resourceId)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceId); // now, look up the resource which is resolved by DiscoverEjbConfigurationXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.REFERENCE_ID, resourceId)) { envRefService.associateEnvironmentToJndi(resource, ref); } } }
private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Element resourceRef, String tagName) { String jndiLocation = $(resourceRef).attr("jndiName"); String resourceId = $(resourceRef).child(tagName).attr("href"); resourceId = StringUtils.substringAfter(resourceId, "WEB-INF/web.xml#"); if (StringUtils.isBlank(resourceId)) { LOG.info("Issue Element: " + $(resourceRef).toString()); return; } if (StringUtils.isNotBlank(jndiLocation)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI: " + jndiLocation + " Resource: " + resourceId); // now, look up the resource for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.REFERENCE_ID, resourceId)) { LOG.info(" - Associating JNDI: " + jndiLocation + " Resource: " + ref); envRefService.associateEnvironmentToJndi(resource, ref); } } }
private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Element resourceRef, String tagName) { String jndiLocation = $(resourceRef).attr("jndiName"); String resourceId = $(resourceRef).child(tagName).attr("href"); resourceId = StringUtils.substringAfter(resourceId, "WEB-INF/web.xml#"); if (StringUtils.isBlank(resourceId)) { LOG.info("Issue Element: " + $(resourceRef).toString()); return; } if (StringUtils.isNotBlank(jndiLocation)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI: " + jndiLocation + " Resource: " + resourceId); // now, look up the resource for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.REFERENCE_ID, resourceId)) { LOG.info(" - Associating JNDI: " + jndiLocation + " Resource: " + ref); envRefService.associateEnvironmentToJndi(resource, ref); } } }
private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Element resourceRef, String tagName) { String href = $(resourceRef).child(tagName).attr("href"); String resourceId = StringUtils.substringAfterLast(href, "ejb-jar.xml#"); String jndiLocation = $(resourceRef).attr("jndiName"); if (StringUtils.isNotBlank(jndiLocation) && StringUtils.isNotBlank(resourceId)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceId); // now, look up the resource which is resolved by DiscoverEjbConfigurationXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.REFERENCE_ID, resourceId)) { envRefService.associateEnvironmentToJndi(resource, ref); } } }
private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Map<String, String> resourceManagerReferences, Element resourceRef, String tagName, String tagJndi) { String jndiLocation = $(resourceRef).child(tagJndi).text(); String resourceRefName = $(resourceRef).child(tagName).text(); String resourceName = $(resourceRef).child("resource-name").text(); LOG.info("Processing binding: "+$(resourceRef).toString()); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); // resolve jndilocation from resourcename...: https://docs.jboss.org/ejb3/app-server/tutorial/jboss_resource_ref/META-INF/jboss.xml if (StringUtils.isBlank(jndiLocation) && StringUtils.isNotBlank(resourceName)) { jndiLocation = resourceManagerReferences.get(resourceName); } if (StringUtils.isNotBlank(jndiLocation) && StringUtils.isNotBlank(resourceRefName)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); // now, look up the resource which is resolved by DiscoverEjbConfigurationXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName)) { envRefService.associateEnvironmentToJndi(resource, ref); } } }
private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Element resourceRef, String tagName, String tagJndi) { String jndiLocation = $(resourceRef).child(tagJndi).text(); String resourceRefName = $(resourceRef).child(tagName).text(); if (StringUtils.isNotBlank(jndiLocation) && StringUtils.isNotBlank(resourceRefName)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); // now, look up the resource which is resolved by DiscoverEjbConfigurationXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName)) { envRefService.associateEnvironmentToJndi(resource, ref); } } }
private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Map<String, String> resourceManagerReferences, Element resourceRef, String tagName, String tagJndi) { String jndiLocation = $(resourceRef).child(tagJndi).text(); String resourceRefName = $(resourceRef).child(tagName).text(); String resourceName = $(resourceRef).child("resource-name").text(); LOG.info("Processing binding: "+$(resourceRef).toString()); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); // resolve jndilocation from resourcename...: https://docs.jboss.org/ejb3/app-server/tutorial/jboss_resource_ref/META-INF/jboss.xml if (StringUtils.isBlank(jndiLocation) && StringUtils.isNotBlank(resourceName)) { jndiLocation = resourceManagerReferences.get(resourceName); } if (StringUtils.isNotBlank(jndiLocation) && StringUtils.isNotBlank(resourceRefName)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); // now, look up the resource which is resolved by DiscoverEjbConfigurationXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName)) { envRefService.associateEnvironmentToJndi(resource, ref); } } }
private void processBinding(EnvironmentReferenceService envRefService, JNDIResourceService jndiResourceService, Set<ProjectModel> applications, Element resourceRef, String tagName, String tagJndi) { String jndiLocation = $(resourceRef).child(tagJndi).text(); String resourceRefName = $(resourceRef).child(tagName).text(); if (StringUtils.isNotBlank(jndiLocation) && StringUtils.isNotBlank(resourceRefName)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); // now, look up the resource which is resolved by DiscoverEjbConfigurationXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName)) { envRefService.associateEnvironmentToJndi(resource, ref); } } }
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName)) LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName))
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName)) LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName))
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName))
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName))
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) { EnvironmentReferenceService envRefService = new EnvironmentReferenceService(event.getGraphContext()); JNDIResourceService jndiResourceService = new JNDIResourceService(event.getGraphContext()); XmlFileService xmlFileService = new XmlFileService(event.getGraphContext()); TechnologyTagService technologyTagService = new TechnologyTagService(event.getGraphContext()); Document doc = xmlFileService.loadDocumentQuiet(event, context, payload); VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); // mark as vendor extension; create reference to web.xml vendorSpecificationService.associateAsVendorExtension(payload, "web.xml"); technologyTagService.addTagToFileModel(payload, "WebLogic Web XML", TechnologyTagLevel.IMPORTANT); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), payload.getProjectModel()); for (Element resourceRef : $(doc).find("resource-description").get()) { String jndiLocation = $(resourceRef).child("jndi-name").text(); String resourceName = $(resourceRef).child("res-ref-name").text(); if (StringUtils.isNotBlank(jndiLocation)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI: " + jndiLocation + " Resource: " + resourceName); // now, look up the resource by name, and associate the type which is resolved by DiscoverWebXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName)) { envRefService.associateEnvironmentToJndi(resource, ref); } } } }
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) { EnvironmentReferenceService envRefService = new EnvironmentReferenceService(event.getGraphContext()); JNDIResourceService jndiResourceService = new JNDIResourceService(event.getGraphContext()); XmlFileService xmlFileService = new XmlFileService(event.getGraphContext()); TechnologyTagService technologyTagService = new TechnologyTagService(event.getGraphContext()); Document doc = xmlFileService.loadDocumentQuiet(event, context, payload); VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); // mark as vendor extension; create reference to web.xml vendorSpecificationService.associateAsVendorExtension(payload, "web.xml"); technologyTagService.addTagToFileModel(payload, "WebLogic Web XML", TechnologyTagLevel.IMPORTANT); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), payload.getProjectModel()); for (Element resourceRef : $(doc).find("resource-description").get()) { String jndiLocation = $(resourceRef).child("jndi-name").text(); String resourceName = $(resourceRef).child("res-ref-name").text(); if (StringUtils.isNotBlank(jndiLocation)) { JNDIResourceModel resource = jndiResourceService.createUnique(applications, jndiLocation); LOG.info("JNDI: " + jndiLocation + " Resource: " + resourceName); // now, look up the resource by name, and associate the type which is resolved by DiscoverWebXmlRuleProvider for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName)) { envRefService.associateEnvironmentToJndi(resource, ref); } } } }
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName)) LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName))
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName)) LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceRefName); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceRefName))
for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName))
for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.NAME, resourceName))
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceId); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.REFERENCE_ID, resourceId))
LOG.info("JNDI Name: " + jndiLocation + " to Resource: " + resourceId); for (EnvironmentReferenceModel ref : envRefService.findAllByProperty(EnvironmentReferenceModel.REFERENCE_ID, resourceId))