Package org.apache.nifi.parameter
Interface ParameterProvider
- All Superinterfaces:
ConfigurableComponent
- All Known Implementing Classes:
AbstractParameterProvider
Defines a provider that is responsible for fetching from an external source Parameters with
which a ParameterContext can be populated.
ParameterProvider
s are discovered following Java's
ServiceLoader
pattern. As a result, all implementations must
follow these rules:
- The implementation must implement this interface.
- The implementation must have a file named
org.apache.nifi.parameter.ParameterProvider located within the jar's
META-INF/services
directory. This file contains a list of fully-qualified class names of allParameterProvider
s in the jar, one-per-line. - The implementation must support a default constructor.
All implementations of this interface must be thread-safe.
Parameter Providers may choose to annotate a method with the
@OnConfigurationRestored
annotation. If this is done, that method
will be invoked after all properties have been set for the ParameterProvider and
before its parameters are fetched.
-
Method Summary
Modifier and TypeMethodDescriptionfetchParameters
(ConfigurationContext context) Fetches named groups of parameters from an external source.void
Provides the Parameter Provider with access to objects that may be of use throughout the life of the providerMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
-
Method Details
-
initialize
Provides the Parameter Provider with access to objects that may be of use throughout the life of the provider- Parameters:
config
- of initialization context- Throws:
InitializationException
- if unable to init
-
fetchParameters
Fetches named groups of parameters from an external source. Any referencing Parameter Context will only receive the Parameters from a group if the Parameter Context name matches the group name (ignoring case) and the reference sensitivity matches the group sensitivity. If group name is null, all referencing Parameter Contexts will receive the Parameters in that group, regardless of their name. If more than one ProvidedParameterGroup matches a given ParameterContext, all parameters from these groups will be applied. However, if any parameters among these matching groups have the same name but different value, the framework will throw aRuntimeException
- Parameters:
context
- TheConfigurationContext
for the provider- Returns:
- A list of fetched Parameter groups. The framework will set the sensitivity appropriately based on how the ParameterProvider is referenced in a ParameterContext.
- Throws:
IOException
- if there is an I/O problem while fetching the Parameters
-