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 ClassesModifier and TypeClassDescription(package private) static enum(package private) static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate static final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetermineMatchingPredicate(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) determineMatchingPredicateBasedOnEnumeration(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) determineMatchingPredicateBasedOnRegex(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) private static PatterngetAttributeRegex(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) private static StringgetAttributeSet(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) private static Stringprivate static FilterAttribute.FilterModegetFilterMode(org.apache.nifi.processor.ProcessContext context) private static FilterAttribute.MatchingStrategygetMatchingStrategy(org.apache.nifi.processor.ProcessContext context) Set<org.apache.nifi.processor.Relationship> protected List<org.apache.nifi.components.PropertyDescriptor> voidonScheduled(org.apache.nifi.processor.ProcessContext context) voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods 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
-
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
-
DELIMITER_VALUE
- See Also:
-
cachedMatchingPredicate
-
-
Constructor Details
-
FilterAttribute
public FilterAttribute()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.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:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
determineMatchingPredicate
-
determineMatchingPredicateBasedOnEnumeration
-
determineMatchingPredicateBasedOnRegex
-
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
-
getAttributeRegex
private static Pattern getAttributeRegex(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
-