Class FilterAttribute

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.FilterAttribute
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@SideEffectFree @SupportsBatching(defaultDuration=TWENTY_FIVE_MILLIS) @InputRequirement(INPUT_REQUIRED) @Tags({"attributes","modification","filter","retain","remove","delete","regex","regular expression","Attribute Expression Language"}) @CapabilityDescription("Filters the attributes of a FlowFile by retaining specified attributes and removing the rest or by removing specified attributes and retaining the rest.") @UseCase(description="Retain all FlowFile attributes matching a regular expression",configuration="Set \"Filter Mode\" to \"Retain\".\nSet \"Attribute Matching Strategy\" to \"Use regular expression\".\nSpecify the \"Filtered Attributes Pattern\", e.g. \"my-property|a-prefix[.].*\".\n") @UseCase(description="Remove only a specified set of FlowFile attributes",configuration="Set \"Filter Mode\" to \"Remove\".\nSet \"Attribute Matching Strategy\" to \"Enumerate attributes\".\nSpecify the set of \"Filtered Attributes\" using the delimiter comma \',\', e.g. \"my-property,other,filename\".\n") public class FilterAttribute extends org.apache.nifi.processor.AbstractProcessor
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static enum 
     
    (package private) static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private Predicate<String>
     
    private static final String
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private Predicate<String>
    determineMatchingPredicate(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
     
    private static Predicate<String>
    determineMatchingPredicateBasedOnEnumeration(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
     
    private static Predicate<String>
    determineMatchingPredicateBasedOnRegex(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
     
    private static Pattern
    getAttributeRegex(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
     
    private static String
    getAttributeSet(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
     
    private static String
     
    getFilterMode(org.apache.nifi.processor.ProcessContext context)
     
    getMatchingStrategy(org.apache.nifi.processor.ProcessContext context)
     
    Set<org.apache.nifi.processor.Relationship>
     
    protected List<org.apache.nifi.components.PropertyDescriptor>
     
    void
    onScheduled(org.apache.nifi.processor.ProcessContext context)
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.nifi.components.ConfigurableComponent

    getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.processor.Processor

    isStateful, migrateProperties, migrateRelationships
  • Field Details

    • REL_SUCCESS

      public static final org.apache.nifi.processor.Relationship REL_SUCCESS
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • FILTER_MODE

      public static final org.apache.nifi.components.PropertyDescriptor FILTER_MODE
    • MATCHING_STRATEGY

      public static final org.apache.nifi.components.PropertyDescriptor MATCHING_STRATEGY
    • ATTRIBUTE_ENUMERATION

      public static final org.apache.nifi.components.PropertyDescriptor ATTRIBUTE_ENUMERATION
    • ATTRIBUTE_PATTERN

      public static final org.apache.nifi.components.PropertyDescriptor ATTRIBUTE_PATTERN
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • DELIMITER_VALUE

      private static final String DELIMITER_VALUE
      See Also:
    • cachedMatchingPredicate

      private volatile Predicate<String> cachedMatchingPredicate
  • Constructor Details

    • FilterAttribute

      public FilterAttribute()
  • Method Details

    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • onScheduled

      @OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context)
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • determineMatchingPredicate

      private Predicate<String> determineMatchingPredicate(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
    • determineMatchingPredicateBasedOnEnumeration

      private static Predicate<String> determineMatchingPredicateBasedOnEnumeration(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
    • determineMatchingPredicateBasedOnRegex

      private static Predicate<String> determineMatchingPredicateBasedOnRegex(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
    • getFilterMode

      private static FilterAttribute.FilterMode getFilterMode(org.apache.nifi.processor.ProcessContext context)
    • getMatchingStrategy

      private static FilterAttribute.MatchingStrategy getMatchingStrategy(org.apache.nifi.processor.ProcessContext context)
    • getAttributeSet

      private static String getAttributeSet(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
    • getDelimiter

      private static String getDelimiter()
    • getAttributeRegex

      private static Pattern getAttributeRegex(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)