Class GetMongo

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

@Tags({"mongodb","read","get"}) @InputRequirement(INPUT_ALLOWED) @CapabilityDescription("Creates FlowFiles from documents in MongoDB loaded by a user-specified query.") @WritesAttribute(attribute="mongo.database.name",description="The database where the results came from.") @WritesAttribute(attribute="mongo.collection.name",description="The collection where the results came from.") public class GetMongo extends AbstractMongoQueryProcessor
  • Field Details

    • SEND_EMPTY_RESULTS

      public static final org.apache.nifi.components.PropertyDescriptor SEND_EMPTY_RESULTS
    • YES_PP

      static final org.apache.nifi.components.AllowableValue YES_PP
    • NO_PP

      static final org.apache.nifi.components.AllowableValue NO_PP
    • USE_PRETTY_PRINTING

      static final org.apache.nifi.components.PropertyDescriptor USE_PRETTY_PRINTING
    • RELATIONSHIPS

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

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

      private org.apache.nifi.logging.ComponentLog logger
    • sendEmpty

      private boolean sendEmpty
  • Constructor Details

    • GetMongo

      public GetMongo()
  • Method Details

    • onScheduled

      @OnScheduled public void onScheduled(org.apache.nifi.context.PropertyContext context)
    • 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
    • buildBatch

      private String buildBatch(List<org.bson.Document> documents, String jsonTypeSetting, String prettyPrintSetting) throws IOException
      Throws:
      IOException
    • getObjectWriter

      private com.fasterxml.jackson.databind.ObjectWriter getObjectWriter(com.fasterxml.jackson.databind.ObjectMapper mapper, String ppSetting)
    • 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