Class AbstractConfigurableComponent
- All Implemented Interfaces:
ConfigurableComponent
- Direct Known Subclasses:
AbstractControllerService
,AbstractFlowAnalysisRule
,AbstractFlowRegistryClient
,AbstractParameterProvider
,AbstractReportingTask
,AbstractSessionFactoryProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
<ValidationResult> customValidate
(ValidationContext validationContext) Allows subclasses to perform their own validation on the already set properties.boolean
final PropertyDescriptor
getPropertyDescriptor
(String descriptorName) private PropertyDescriptor
getPropertyDescriptor
(PropertyDescriptor specDescriptor) final List
<PropertyDescriptor> Returns aList
of allPropertyDescriptor
s that this component supports.protected PropertyDescriptor
getSupportedDynamicPropertyDescriptor
(String propertyDescriptorName) Used to allow subclasses to determine what PropertyDescriptor if any to use when a property is requested for which a descriptor is not already registered.private PropertyDescriptor
getSupportedPropertyDescriptor
(PropertyDescriptor specDescriptor) protected List
<PropertyDescriptor> Allows subclasses to register which property descriptor objects are supported.int
hashCode()
void
onPropertyModified
(PropertyDescriptor descriptor, String oldValue, String newValue) Hook method allowing subclasses to eagerly react to a configuration change for the given property descriptor.toString()
final Collection
<ValidationResult> validate
(ValidationContext context) Validates a set of properties, returning ValidationResults for any invalid properties.private void
validateDependencies
(PropertyDescriptor descriptor, ValidationContext context, Collection<ValidationResult> results) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier
-
Constructor Details
-
AbstractConfigurableComponent
public AbstractConfigurableComponent()
-
-
Method Details
-
customValidate
Allows subclasses to perform their own validation on the already set properties. Since each property is validated as it is set this allows validation of groups of properties together. Default return is an empty set. This method will be called only when it has been determined that all property values are valid according to their corresponding PropertyDescriptor's validators.- Parameters:
validationContext
- provides a mechanism for obtaining externally managed values, such as property values and supplies convenience methods for operating on those values- Returns:
- Collection of ValidationResult objects that will be added to any other validation findings - may be null
-
getPropertyDescriptor
- Specified by:
getPropertyDescriptor
in interfaceConfigurableComponent
- Parameters:
descriptorName
- to lookup the descriptor- Returns:
- a PropertyDescriptor for the name specified that is fully populated
-
getPropertyDescriptor
-
getSupportedPropertyDescriptor
-
validate
Description copied from interface:ConfigurableComponent
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.- Specified by:
validate
in interfaceConfigurableComponent
- 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
-
validateDependencies
private void validateDependencies(PropertyDescriptor descriptor, ValidationContext context, Collection<ValidationResult> results) -
onPropertyModified
Hook method allowing subclasses to eagerly react to a configuration change for the given property descriptor. As an alternative to using this method a processor may simply get the latest value whenever it needs it and if necessary lazily evaluate it.- Specified by:
onPropertyModified
in interfaceConfigurableComponent
- Parameters:
descriptor
- of the modified propertyoldValue
- non-null property value (previous)newValue
- the new property value or if null indicates the property was removed
-
getSupportedDynamicPropertyDescriptor
Used to allow subclasses to determine what PropertyDescriptor if any to use when a property is requested for which a descriptor is not already registered. By default this method simply returns a null descriptor. By overriding this method processor implementations can support dynamic properties since this allows them to register properties on demand. It is acceptable for a dynamically generated property to indicate it is required so long as it is understood it is only required once set. Dynamic properties by definition cannot be required until used.
This method should be side effect free in the subclasses in terms of how often it is called for a given property name because there is guarantees how often it will be called for a given property name.
Default is null.
- Parameters:
propertyDescriptorName
- used to lookup if any property descriptors exist for that name- Returns:
- new property descriptor if supported
-
getSupportedPropertyDescriptors
Allows subclasses to register which property descriptor objects are supported. Default return is an empty set.- Returns:
- PropertyDescriptor objects this processor currently supports
-
getPropertyDescriptors
Description copied from interface:ConfigurableComponent
Returns aList
of allPropertyDescriptor
s that this component supports.- Specified by:
getPropertyDescriptors
in interfaceConfigurableComponent
- Returns:
- PropertyDescriptor objects this component currently supports
-
equals
-
hashCode
public int hashCode() -
toString
-