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
  • Field Details

    • TEXT_ENCODING

      public static final String TEXT_ENCODING
      See Also:
    • BINARY_ENCODING

      public static final String BINARY_ENCODING
      See Also:
    • MATCH_ATTRIBUTE_KEY

      public static final String 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

      private static final List<org.apache.nifi.components.PropertyDescriptor> 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

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

      public static final Charset UTF8
    • fileWatcherRef

      private final AtomicReference<SynchronousFileWatcher> fileWatcherRef
    • searchRef

      private final AtomicReference<Search<byte[]>> searchRef
    • dictionaryUpdateLock

      private final ReentrantLock dictionaryUpdateLock
  • Constructor Details

    • ScanContent

      public ScanContent()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • 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
    • onPropertyModified

      public void onPropertyModified(org.apache.nifi.components.PropertyDescriptor descriptor, String oldValue, String newValue)
      Specified by:
      onPropertyModified in interface org.apache.nifi.components.ConfigurableComponent
      Overrides:
      onPropertyModified in class org.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:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException