Class AbstractMongoProcessor

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.mongodb.AbstractMongoProcessor
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor
Direct Known Subclasses:
AbstractMongoQueryProcessor, DeleteMongo, PutMongo, PutMongoBulkOperations, PutMongoRecord, RunMongoAggregation

public abstract class AbstractMongoProcessor extends org.apache.nifi.processor.AbstractProcessor
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    protected static final org.apache.nifi.components.AllowableValue
     
    protected static final org.apache.nifi.components.AllowableValue
     
    protected static final org.apache.nifi.components.PropertyDescriptor
     
    protected static final String
     
    protected static final String
     
    protected com.mongodb.client.MongoClient
     
    protected com.fasterxml.jackson.databind.ObjectMapper
     
    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.components.PropertyDescriptor
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
     
    protected void
    configureMapper(String setting, String dateFormat)
     
    final void
    createClient(org.apache.nifi.processor.ProcessContext context)
     
    protected com.mongodb.MongoClientSettings.Builder
     
    protected com.mongodb.client.MongoCollection<org.bson.Document>
    getCollection(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
     
    protected static List<org.apache.nifi.components.PropertyDescriptor>
     
    protected com.mongodb.client.MongoDatabase
    getDatabase(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
     
    protected String
    getURI(org.apache.nifi.processor.ProcessContext context)
     
    protected boolean
    updateModeMatches(AbstractMongoProcessor.UpdateMethod updateMethodToMatch, AbstractMongoProcessor.UpdateMethod configuredUpdateMethod, org.apache.nifi.flowfile.FlowFile flowFile)
    Checks if given update mode option matches for the incoming flow file
    protected void
    writeBatch(String payload, org.apache.nifi.flowfile.FlowFile parent, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, Map<String,String> extraAttributes, org.apache.nifi.processor.Relationship rel)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger, onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, getSupportedPropertyDescriptors, 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
  • Field Details

    • ATTRIBUTE_MONGODB_UPDATE_MODE

      public static final String ATTRIBUTE_MONGODB_UPDATE_MODE
      See Also:
    • JSON_TYPE_EXTENDED

      protected static final String JSON_TYPE_EXTENDED
      See Also:
    • JSON_TYPE_STANDARD

      protected static final String JSON_TYPE_STANDARD
      See Also:
    • JSON_EXTENDED

      protected static final org.apache.nifi.components.AllowableValue JSON_EXTENDED
    • JSON_STANDARD

      protected static final org.apache.nifi.components.AllowableValue JSON_STANDARD
    • CLIENT_SERVICE

      static final org.apache.nifi.components.PropertyDescriptor CLIENT_SERVICE
    • DATABASE_NAME

      static final org.apache.nifi.components.PropertyDescriptor DATABASE_NAME
    • COLLECTION_NAME

      static final org.apache.nifi.components.PropertyDescriptor COLLECTION_NAME
    • JSON_TYPE

      protected static final org.apache.nifi.components.PropertyDescriptor JSON_TYPE
    • RESULTS_PER_FLOWFILE

      static final org.apache.nifi.components.PropertyDescriptor RESULTS_PER_FLOWFILE
    • BATCH_SIZE

      static final org.apache.nifi.components.PropertyDescriptor BATCH_SIZE
    • QUERY_ATTRIBUTE

      static final org.apache.nifi.components.PropertyDescriptor QUERY_ATTRIBUTE
    • CHARSET

      static final org.apache.nifi.components.PropertyDescriptor CHARSET
    • DATE_FORMAT

      static final org.apache.nifi.components.PropertyDescriptor DATE_FORMAT
    • PROPERTY_DESCRIPTORS

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

      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • mongoClient

      protected com.mongodb.client.MongoClient mongoClient
    • clientService

      protected MongoDBClientService clientService
  • Constructor Details

    • AbstractMongoProcessor

      public AbstractMongoProcessor()
  • Method Details

    • getCommonPropertyDescriptors

      protected static List<org.apache.nifi.components.PropertyDescriptor> getCommonPropertyDescriptors()
    • createClient

      @OnScheduled public final void createClient(org.apache.nifi.processor.ProcessContext context)
    • getClientSettings

      protected com.mongodb.MongoClientSettings.Builder getClientSettings(String uri, SSLContext sslContext)
    • closeClient

      @OnStopped public final void closeClient()
    • getDatabase

      protected com.mongodb.client.MongoDatabase getDatabase(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
    • getCollection

      protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile)
    • getURI

      protected String getURI(org.apache.nifi.processor.ProcessContext context)
    • writeBatch

      protected void writeBatch(String payload, org.apache.nifi.flowfile.FlowFile parent, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, Map<String,String> extraAttributes, org.apache.nifi.processor.Relationship rel) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • configureMapper

      protected void configureMapper(String setting, String dateFormat)
    • updateModeMatches

      protected boolean updateModeMatches(AbstractMongoProcessor.UpdateMethod updateMethodToMatch, AbstractMongoProcessor.UpdateMethod configuredUpdateMethod, org.apache.nifi.flowfile.FlowFile flowFile)
      Checks if given update mode option matches for the incoming flow file
      Parameters:
      updateMethodToMatch - the value against which processor's mode is compared
      configuredUpdateMethod - the value coming from running processor
      flowFile - incoming flow file to extract processor mode
      Returns:
      true if the incoming files update mode matches with updateMethodToMatch