public static BundleDTO getBundle(final Element bundleElement) { if (bundleElement == null) { return null; } final Element groupElement = DomUtils.getChild(bundleElement, "group"); final Element artifactElement = DomUtils.getChild(bundleElement, "artifact"); final Element versionElement = DomUtils.getChild(bundleElement, "version"); return new BundleDTO(groupElement.getTextContent(), artifactElement.getTextContent(), versionElement.getTextContent()); }
public static BundleDTO createBundleDto(final Bundle bundle) { return new BundleDTO(bundle.getGroup(), bundle.getArtifact(), bundle.getVersion()); } }
public BundleDTO copy(final BundleDTO original) { if (original == null) { return null; } final BundleDTO copy = new BundleDTO(); copy.setGroup(original.getGroup()); copy.setArtifact(original.getArtifact()); copy.setVersion(original.getVersion()); return copy; }
public static BundleDTO createBundleDto(final org.apache.nifi.registry.flow.Bundle bundle) { final BundleDTO dto = new BundleDTO(); dto.setArtifact(bundle.getArtifact()); dto.setGroup(bundle.getGroup()); dto.setVersion(bundle.getVersion()); return dto; } }
/** * Creates a bundle DTO from the specified class. * * @param coordinate bundle coordinates * @return dto */ public BundleDTO createBundleDto(final BundleCoordinate coordinate) { final BundleDTO dto = new BundleDTO(); dto.setGroup(coordinate.getGroup()); dto.setArtifact(coordinate.getId()); dto.setVersion(coordinate.getVersion()); return dto; }
try { final BundleCoordinate bundle = BundleUtils.getCompatibleBundle(extensionManager, processor.getType(), processor.getBundle()); processors.add(getConfigurableComponent(processor.getType(), new BundleDTO(bundle.getGroup(), bundle.getId(), bundle.getVersion()))); } catch (final IllegalStateException e) { try { final BundleCoordinate bundle = BundleUtils.getCompatibleBundle(extensionManager, controllerService.getType(), controllerService.getBundle()); controllerServices.add(getConfigurableComponent(controllerService.getType(), new BundleDTO(bundle.getGroup(), bundle.getId(), bundle.getVersion()))); } catch (final IllegalStateException e) {
/** * Discovers the compatible bundle details for the components in the specified snippet. * * @param snippet the snippet */ private void discoverCompatibleBundles(final FlowSnippetDTO snippet) { if (snippet.getProcessors() != null) { snippet.getProcessors().forEach(processor -> { final BundleCoordinate coordinate = serviceFacade.getCompatibleBundle(processor.getType(), processor.getBundle()); processor.setBundle(new BundleDTO(coordinate.getGroup(), coordinate.getId(), coordinate.getVersion())); }); } if (snippet.getControllerServices() != null) { snippet.getControllerServices().forEach(controllerService -> { final BundleCoordinate coordinate = serviceFacade.getCompatibleBundle(controllerService.getType(), controllerService.getBundle()); controllerService.setBundle(new BundleDTO(coordinate.getGroup(), coordinate.getId(), coordinate.getVersion())); }); } if (snippet.getProcessGroups() != null) { snippet.getProcessGroups().forEach(processGroup -> { discoverCompatibleBundles(processGroup.getContents()); }); } }