/** * Makes the file model a vendor extension, and references a local file (if exists) * * @param model * @param localFileName */ public VendorSpecificationExtensionModel associateAsVendorExtension(FileModel model, String localFileName) { String pathToDescriptor = model.getFilePath(); pathToDescriptor = StringUtils.removeEnd(pathToDescriptor, model.getFileName()); pathToDescriptor += localFileName; // now look up the FileModel specificationFile = fileService.getUniqueByProperty(FileModel.FILE_PATH, pathToDescriptor); VendorSpecificationExtensionModel extension = addTypeToModel(model); if (specificationFile == null) { LOG.warning("File not found: " + pathToDescriptor); } else { // now associate current model with vendorspecificationextension extension.setSpecificationFile(specificationFile); } return extension; } }
public VendorSpecificationExtensionService(GraphContext context) { super(context, VendorSpecificationExtensionModel.class); fileService = new FileService(this.getGraphContext()); }
@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); } } } }
VendorSpecificationExtensionService vendorSpecificService = new VendorSpecificationExtensionService(context); generatedDescriptor.setLink(applicationReportModel.getReportFilename()); for (VendorSpecificationExtensionModel vendorSpecificExtension : vendorSpecificService.getVendorSpecificationExtensions(webDescriptor))
@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); } } } }
VendorSpecificationExtensionService vendorSpecificService = new VendorSpecificationExtensionService(context); generatedDescriptor.setLink(applicationReportModel.getReportFilename()); for (VendorSpecificationExtensionModel vendorSpecificExtension : vendorSpecificService.getVendorSpecificationExtensions(webDescriptor))
technologyTagService.addTagToFileModel(payload, "WebSphere EJB Ext", TechnologyTagLevel.IMPORTANT); VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); vendorSpecificationService.associateAsVendorExtension(payload, "ejb-jar.xml");
private void createReport(GraphRewrite event, EvaluationContext evaluationContext, GraphContext context, ProjectModel projectModel) VendorSpecificationExtensionService vendorSpecificService = new VendorSpecificationExtensionService(context); LinkService linkService = new LinkService(context); newDescriptorLink.setLink(applicationReportModel.getReportFilename()); for (VendorSpecificationExtensionModel vendorSpecificExtension : vendorSpecificService.getVendorSpecificationExtensions(ejbDescriptor))
public VendorSpecificationExtensionService(GraphContext context) { super(context, VendorSpecificationExtensionModel.class); fileService = new FileService(this.getGraphContext()); }
/** * Makes the file model a vendor extension, and references a local file (if exists) * * @param model * @param localFileName */ public VendorSpecificationExtensionModel associateAsVendorExtension(FileModel model, String localFileName) { String pathToDescriptor = model.getFilePath(); pathToDescriptor = StringUtils.removeEnd(pathToDescriptor, model.getFileName()); pathToDescriptor += localFileName; // now look up the FileModel specificationFile = fileService.getUniqueByProperty(FileModel.FILE_PATH, pathToDescriptor); VendorSpecificationExtensionModel extension = addTypeToModel(model); if (specificationFile == null) { LOG.warning("File not found: " + pathToDescriptor); } else { // now associate current model with vendorspecificationextension extension.setSpecificationFile(specificationFile); } return extension; } }
technologyTagService.addTagToFileModel(payload, "WebSphere EJB Ext", TechnologyTagLevel.IMPORTANT); VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); vendorSpecificationService.associateAsVendorExtension(payload, "ejb-jar.xml");
private void createReport(GraphRewrite event, EvaluationContext evaluationContext, GraphContext context, ProjectModel projectModel) VendorSpecificationExtensionService vendorSpecificService = new VendorSpecificationExtensionService(context); LinkService linkService = new LinkService(context); newDescriptorLink.setLink(applicationReportModel.getReportFilename()); for (VendorSpecificationExtensionModel vendorSpecificExtension : vendorSpecificService.getVendorSpecificationExtensions(ejbDescriptor))
public Iterable<VendorSpecificationExtensionModel> getVendorSpecificationExtensions(FileModel model) { GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(model.getElement()); pipeline.out(VendorSpecificationExtensionModel.REF); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(VendorSpecificationExtensionModel.TYPE)); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), VendorSpecificationExtensionModel.class); }
GraphService<EjbSessionBeanModel> ejbSessionBeanService = new GraphService<>(event.getGraphContext(), EjbSessionBeanModel.class); GraphService<EjbMessageDrivenModel> mdbService = new GraphService<>(event.getGraphContext(), EjbMessageDrivenModel.class); VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); vendorSpecificationService.associateAsVendorExtension(payload, "ejb-jar.xml");
public Iterable<VendorSpecificationExtensionModel> getVendorSpecificationExtensions(FileModel model) { GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(model.getElement()); pipeline.out(VendorSpecificationExtensionModel.REF); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(VendorSpecificationExtensionModel.TYPE)); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), VendorSpecificationExtensionModel.class); }
VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); vendorSpecificationService.associateAsVendorExtension(payload, "web.xml");
GraphService<EjbSessionBeanModel> ejbSessionBeanService = new GraphService<>(event.getGraphContext(), EjbSessionBeanModel.class); GraphService<EjbMessageDrivenModel> mdbService = new GraphService<>(event.getGraphContext(), EjbMessageDrivenModel.class); VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); vendorSpecificationService.associateAsVendorExtension(payload, "ejb-jar.xml");
VendorSpecificationExtensionService vendorSpecificationService = new VendorSpecificationExtensionService(event.getGraphContext()); vendorSpecificationService.associateAsVendorExtension(payload, "web.xml");
@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()); // Classification done by websphere-xml-06000 - see WINDUPRULE-164 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"); TechnologyTagModel technologyTag = technologyTagService.addTagToFileModel(payload, "WebSphere Web XML", TechnologyTagLevel.IMPORTANT); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), payload.getProjectModel()); for (Element resourceRef : $(doc).find("resRefBindings").get()) { processBinding(envRefService, jndiResourceService, applications, resourceRef, "bindingResourceRef"); } for (Element resourceRef : $(doc).find("ejbRefBindings").get()) { processBinding(envRefService, jndiResourceService, applications, resourceRef, "bindingEjbRef"); } for (Element resourceRef : $(doc).find("messageDestinationRefBindings").get()) { processBinding(envRefService, jndiResourceService, applications, resourceRef, "bindingMessageDestinationRef"); } }
@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()); // Classification done by websphere-xml-06000 - see WINDUPRULE-164 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"); TechnologyTagModel technologyTag = technologyTagService.addTagToFileModel(payload, "WebSphere Web XML", TechnologyTagLevel.IMPORTANT); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), payload.getProjectModel()); for (Element resourceRef : $(doc).find("resRefBindings").get()) { processBinding(envRefService, jndiResourceService, applications, resourceRef, "bindingResourceRef"); } for (Element resourceRef : $(doc).find("ejbRefBindings").get()) { processBinding(envRefService, jndiResourceService, applications, resourceRef, "bindingEjbRef"); } for (Element resourceRef : $(doc).find("messageDestinationRefBindings").get()) { processBinding(envRefService, jndiResourceService, applications, resourceRef, "bindingMessageDestinationRef"); } }