- All Known Subinterfaces:
ControllerService,FlowAnalysisRule,FlowRegistryClient,ParameterProvider,Processor,ReportingTask
- All Known Implementing Classes:
AbstractConfigurableComponent,AbstractControllerService,AbstractFlowAnalysisRule,AbstractFlowRegistryClient,AbstractParameterProvider,AbstractProcessor,AbstractReportingTask,AbstractSessionFactoryProcessor
-
Method Summary
Modifier and TypeMethodDescriptiongetPropertyDescriptor(String name) Returns aListof allPropertyDescriptors that this component supports.voidonPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) Hook method allowing subclasses to eagerly react to a configuration change for the given property descriptor.validate(ValidationContext context) Validates a set of properties, returning ValidationResults for any invalid properties.
-
Method Details
-
validate
Validates a set of properties, returning ValidationResults for any invalid properties. All defined properties will be validated. If they are not included in the purposed configuration, the default value will be used.- Parameters:
context- of validation- Returns:
- Collection of validation result objects for any invalid findings only. If the collection is empty then the component is valid. Guaranteed non-null
-
getPropertyDescriptor
- Parameters:
name- to lookup the descriptor- Returns:
- the PropertyDescriptor with the given name, if it exists;
otherwise, returns
null
-
onPropertyModified
Hook method allowing subclasses to eagerly react to a configuration change for the given property descriptor. This method will be invoked regardless of property validity. As an alternative to using this method, a component may simply get the latest value whenever it needs it and if necessary lazily evaluate it. Any throwable that escapes this method will simply be ignored.
When NiFi is restarted, this method will be called for each 'dynamic' property that is added, as well as for each property that has a value. I.e., even if the Properties are not modified from the default values. If it is undesirable for your use case to react to properties being modified in this situation, you can add the
OnConfigurationRestoredannotation to a method - this will allow the Processor to know when configuration has been restored, so that it can determine whether or not to perform some action in the onPropertyModified method. This can be done as follows:private volatile boolean configurationRestored = false; @OnConfigurationRestored public void onConfigurationRestored() { this.configurationRestored = true; } public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { if (!configurationRestored) { return; } }- Parameters:
descriptor- the descriptor for the property being modifiedoldValue- the value that was previously set. Will benullif no value was previously set for this property, on NiFi startup or on first modification after component is added to flownewValue- the new property value or ifnullindicates the property was removed
-
getPropertyDescriptors
List<PropertyDescriptor> getPropertyDescriptors()Returns aListof allPropertyDescriptors that this component supports.- Returns:
- PropertyDescriptor objects this component currently supports
-
getIdentifier
String getIdentifier()- Returns:
- the unique identifier that the framework assigned to this component
-