Package org.apache.nifi.util
Class BundleUtils
java.lang.Object
org.apache.nifi.util.BundleUtils
Utility class for Bundles.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.apache.nifi.flow.BundlecreateBundle(BundleCoordinate coordinate) static BundleDTOcreateBundleDto(org.apache.nifi.flow.Bundle bundle) static BundleCoordinatediscoverCompatibleBundle(ExtensionManager extensionManager, String type, org.apache.nifi.flow.Bundle bundle) static voiddiscoverCompatibleBundle(ExtensionManager extensionManager, org.apache.nifi.flow.VersionedConfigurableExtension extension) static voiddiscoverCompatibleBundles(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.static voiddiscoverCompatibleBundles(ExtensionManager extensionManager, org.apache.nifi.flow.VersionedReportingTaskSnapshot reportingTaskSnapshot) private static BundleCoordinatefindBundleForType(ExtensionManager extensionManager, String type, BundleCoordinate desiredCoordinate) private static BundleCoordinatefindCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO, boolean allowCompatibleBundle) (package private) static Optional<BundleCoordinate> findOptionalBundleForType(ExtensionManager extensionManager, String type, Bundle frameworkBundle) private static Optional<BundleCoordinate> findOptionalCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO) static BundleCoordinategetBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO) Gets a bundle that supports the specified type.static BundleCoordinategetCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO) Gets a compatible bundle that supports the specified type.static Optional<BundleCoordinate> getOptionalCompatibleBundle(ExtensionManager extensionManager, String type, BundleDTO bundleDTO)
-
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 typebundleDTO- 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 typebundleDTO- 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
-
createBundleDto
-