Class ScanContent
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.ScanContent
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SideEffectFree
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@Tags({"aho-corasick","scan","content","byte sequence","search","find","dictionary"})
@CapabilityDescription("Scans the content of FlowFiles for terms that are found in a user-supplied dictionary. If a term is matched, the UTF-8 encoded version of the term will be added to the FlowFile using the \'matching.term\' attribute")
@WritesAttribute(attribute="matching.term",
description="The term that caused the Processor to route the FlowFile to the \'matched\' relationship; if FlowFile is routed to the \'unmatched\' relationship, this attribute is not added")
public class ScanContent
extends org.apache.nifi.processor.AbstractProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static interfaceprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate final ReentrantLockprivate final AtomicReference<SynchronousFileWatcher> static final Stringprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> private final AtomicReference<Search<byte[]>> static final Stringstatic final Charset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ScanContent.TermLoadercreateTermLoader(org.apache.nifi.processor.ProcessContext context, InputStream in) Set<org.apache.nifi.processor.Relationship> protected List<org.apache.nifi.components.PropertyDescriptor> voidonPropertyModified(org.apache.nifi.components.PropertyDescriptor descriptor, String oldValue, String newValue) voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) private booleanreloadDictionary(org.apache.nifi.processor.ProcessContext context, boolean force, org.apache.nifi.logging.ComponentLog logger) 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, 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, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
TEXT_ENCODING
- See Also:
-
BINARY_ENCODING
- See Also:
-
MATCH_ATTRIBUTE_KEY
- See Also:
-
DICTIONARY
public static final org.apache.nifi.components.PropertyDescriptor DICTIONARY -
DICTIONARY_ENCODING
public static final org.apache.nifi.components.PropertyDescriptor DICTIONARY_ENCODING -
PROPERTY_DESCRIPTORS
-
REL_MATCH
public static final org.apache.nifi.processor.Relationship REL_MATCH -
REL_NO_MATCH
public static final org.apache.nifi.processor.Relationship REL_NO_MATCH -
RELATIONSHIPS
-
UTF8
-
fileWatcherRef
-
searchRef
-
dictionaryUpdateLock
-
-
Constructor Details
-
ScanContent
public ScanContent()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
onPropertyModified
public void onPropertyModified(org.apache.nifi.components.PropertyDescriptor descriptor, String oldValue, String newValue) - Specified by:
onPropertyModifiedin interfaceorg.apache.nifi.components.ConfigurableComponent- Overrides:
onPropertyModifiedin classorg.apache.nifi.components.AbstractConfigurableComponent
-
reloadDictionary
private boolean reloadDictionary(org.apache.nifi.processor.ProcessContext context, boolean force, org.apache.nifi.logging.ComponentLog logger) throws IOException - Throws:
IOException
-
createTermLoader
private ScanContent.TermLoader createTermLoader(org.apache.nifi.processor.ProcessContext context, InputStream in) -
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
-