Class AbstractConfigurableComponent

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
All Implemented Interfaces:
ConfigurableComponent
Direct Known Subclasses:
AbstractControllerService, AbstractFlowAnalysisRule, AbstractFlowRegistryClient, AbstractParameterProvider, AbstractReportingTask, AbstractSessionFactoryProcessor

public abstract class AbstractConfigurableComponent extends Object implements ConfigurableComponent
  • Constructor Details

    • AbstractConfigurableComponent

      public AbstractConfigurableComponent()
  • Method Details

    • customValidate

      protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
      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

      public final PropertyDescriptor getPropertyDescriptor(String descriptorName)
      Specified by:
      getPropertyDescriptor in interface ConfigurableComponent
      Parameters:
      descriptorName - to lookup the descriptor
      Returns:
      a PropertyDescriptor for the name specified that is fully populated
    • getPropertyDescriptor

      private PropertyDescriptor getPropertyDescriptor(PropertyDescriptor specDescriptor)
    • getSupportedPropertyDescriptor

      private PropertyDescriptor getSupportedPropertyDescriptor(PropertyDescriptor specDescriptor)
    • validate

      public final Collection<ValidationResult> validate(ValidationContext context)
      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 interface ConfigurableComponent
      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

      public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue)
      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 interface ConfigurableComponent
      Parameters:
      descriptor - of the modified property
      oldValue - non-null property value (previous)
      newValue - the new property value or if null indicates the property was removed
    • getSupportedDynamicPropertyDescriptor

      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. 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

      protected List<PropertyDescriptor> 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

      public final List<PropertyDescriptor> getPropertyDescriptors()
      Description copied from interface: ConfigurableComponent
      Returns a List of all PropertyDescriptors that this component supports.
      Specified by:
      getPropertyDescriptors in interface ConfigurableComponent
      Returns:
      PropertyDescriptor objects this component currently supports
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object