Class FetchGridFS

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.mongodb.gridfs.AbstractGridFSProcessor
org.apache.nifi.processors.mongodb.gridfs.FetchGridFS
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor, QueryHelper

@InputRequirement(INPUT_REQUIRED) @WritesAttributes(@WritesAttribute(attribute="gridfs.file.metadata",description="The custom metadata stored with a file is attached to this property if it exists.")) @Tags({"fetch","gridfs","mongo"}) @CapabilityDescription("Retrieves one or more files from a GridFS bucket by file name or by a user-defined query.") public class FetchGridFS extends AbstractGridFSProcessor implements QueryHelper
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     

    Fields inherited from class org.apache.nifi.processors.mongodb.gridfs.AbstractGridFSProcessor

    BUCKET_NAME, CLIENT_SERVICE, clientService, DATABASE_NAME, FILE_NAME, QUERY_ATTRIBUTE, REL_FAILURE, REL_SUCCESS

    Fields inherited from interface org.apache.nifi.processors.mongodb.QueryHelper

    MODE_MANY_COMMITS, MODE_ONE_COMMIT, OPERATION_MODE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private String
    getQuery(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile input)
     
    Set<org.apache.nifi.processor.Relationship>
     
    final List<org.apache.nifi.components.PropertyDescriptor>
     
    private void
    handleFile(com.mongodb.client.gridfs.GridFSBucket bucket, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile parent, com.mongodb.client.gridfs.model.GridFSFile input, String query)
     
    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.processors.mongodb.gridfs.AbstractGridFSProcessor

    getBucket, getBucketName, getCommonPropertyDescriptors, getCommonRelationships, getDatabase, getTransitUri

    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

    Methods inherited from interface org.apache.nifi.processors.mongodb.QueryHelper

    readQuery
  • Field Details

    • METADATA_ATTRIBUTE

      static final String METADATA_ATTRIBUTE
      See Also:
    • QUERY

      static final org.apache.nifi.components.PropertyDescriptor QUERY
    • REL_ORIGINAL

      static final org.apache.nifi.processor.Relationship REL_ORIGINAL
    • PROPERTY_DESCRIPTORS

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

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

    • FetchGridFS

      public FetchGridFS()
  • 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

      public final List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • getQuery

      private String getQuery(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile input) throws IOException
      Throws:
      IOException
    • 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
    • handleFile

      private void handleFile(com.mongodb.client.gridfs.GridFSBucket bucket, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile parent, com.mongodb.client.gridfs.model.GridFSFile input, String query)