Class BundleUtils

java.lang.Object
org.apache.nifi.util.BundleUtils

public final class BundleUtils extends Object
Utility class for Bundles.
  • Constructor Details

    • BundleUtils

      public BundleUtils()
  • Method Details

    • findOptionalBundleForType

      static Optional<BundleCoordinate> findOptionalBundleForType(ExtensionManager extensionManager, String type, Bundle frameworkBundle)
    • findBundleForType

      private static BundleCoordinate findBundleForType(ExtensionManager extensionManager, String type, BundleCoordinate desiredCoordinate)
    • findCompatibleBundle

      private static BundleCoordinate findCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO, boolean allowCompatibleBundle)
    • findOptionalCompatibleBundle

      private static Optional<BundleCoordinate> findOptionalCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO)
    • getBundle

      public static BundleCoordinate getBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO)
      Gets a bundle that supports the specified type. If the bundle is specified, an exact match must be available.
      • If bundleDTO is specified
        • Matching bundle found
          • If bundle supports type, use it
          • If bundle doesn't support type, throw IllegalStateException
        • No matching bundle found, IllegalStateException
      • If bundleDTO is not specified
        • One bundle that supports the specified type, use it
        • No bundle that supports the specified type, IllegalStateException
        • Multiple bundle that supports the specified type, IllegalStateException
      Parameters:
      type - the component type
      bundleDTO - bundle to find the component
      Returns:
      the bundle coordinate
      Throws:
      IllegalStateException - bundle not found
    • getCompatibleBundle

      public static BundleCoordinate getCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO)
      Gets a compatible bundle that supports the specified type. If the bundle is specified but is not available, a compatible bundle may be returned if there is only one.
      • If bundleDTO is specified
        • Matching bundle found
          • If bundle supports type, use it
          • If bundle doesn't support type, throw IllegalStateException
        • No matching bundle found
          • One bundle that supports the specified type, use it
          • No bundle that supports the specified type, IllegalStateException
          • Multiple bundle that supports the specified type, IllegalStateException
      • If bundleDTO is not specified
        • One bundle that supports the specified type, use it
        • No bundle that supports the specified type, IllegalStateException
        • Multiple bundle that supports the specified type, IllegalStateException
      Parameters:
      type - the component type
      bundleDTO - bundle to find the component
      Returns:
      the bundle coordinate
      Throws:
      IllegalStateException - no compatible bundle found
    • getOptionalCompatibleBundle

      public static Optional<BundleCoordinate> getOptionalCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO)
    • discoverCompatibleBundles

      public static void discoverCompatibleBundles(ExtensionManager extensionManager, org.apache.nifi.flow.VersionedProcessGroup versionedGroup)
      Discovers the compatible bundle details for the components in the specified Versioned Process Group and updates the Versioned Process Group to reflect the appropriate bundles.
      Parameters:
      versionedGroup - the versioned group
    • discoverCompatibleBundles

      public static void discoverCompatibleBundles(ExtensionManager extensionManager, org.apache.nifi.flow.VersionedReportingTaskSnapshot reportingTaskSnapshot)
    • discoverCompatibleBundle

      public static void discoverCompatibleBundle(ExtensionManager extensionManager, org.apache.nifi.flow.VersionedConfigurableExtension extension)
    • discoverCompatibleBundle

      public static BundleCoordinate discoverCompatibleBundle(ExtensionManager extensionManager, String type, org.apache.nifi.flow.Bundle bundle)
    • createBundle

      private static org.apache.nifi.flow.Bundle createBundle(BundleCoordinate coordinate)
    • createBundleDto

      public static BundleDTO createBundleDto(org.apache.nifi.flow.Bundle bundle)