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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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.PropertyDescriptorprotected MongoDBClientService(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.PropertyDescriptorprotected static final org.apache.nifi.components.AllowableValueprotected static final org.apache.nifi.components.AllowableValueprotected static final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprotected static final Stringprotected com.mongodb.client.MongoClientprotected com.fasterxml.jackson.databind.ObjectMapperprivate 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 -
Method Summary
Modifier and TypeMethodDescriptionfinal voidprotected voidconfigureMapper(String setting, String dateFormat) final voidcreateClient(org.apache.nifi.processor.ProcessContext context) protected com.mongodb.MongoClientSettings.BuildergetClientSettings(String uri, SSLContext sslContext) 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.MongoDatabasegetDatabase(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) protected StringgetURI(org.apache.nifi.processor.ProcessContext context) protected booleanupdateModeMatches(AbstractMongoProcessor.UpdateMethod updateMethodToMatch, AbstractMongoProcessor.UpdateMethod configuredUpdateMethod, org.apache.nifi.flowfile.FlowFile flowFile) Checks if given update mode option matches for the incoming flow fileprotected voidwriteBatch(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, onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, getSupportedPropertyDescriptors, hashCode, onPropertyModified, 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, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
ATTRIBUTE_MONGODB_UPDATE_MODE
- See Also:
-
JSON_TYPE_EXTENDED
- See Also:
-
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
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
mongoClient
protected com.mongodb.client.MongoClient mongoClient -
clientService
-
-
Constructor Details
-
AbstractMongoProcessor
public AbstractMongoProcessor()
-
-
Method Details
-
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
-
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
-
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 comparedconfiguredUpdateMethod- the value coming from running processorflowFile- incoming flow file to extract processor mode- Returns:
- true if the incoming files update mode matches with updateMethodToMatch
-