Package org.apache.nifi.mongodb
Class MongoDBLookupService
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.controller.AbstractControllerService
org.apache.nifi.serialization.SchemaRegistryService
org.apache.nifi.serialization.JsonInferenceSchemaRegistryService
org.apache.nifi.mongodb.MongoDBLookupService
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.controller.ControllerService,LookupService<Object>
@Tags({"mongo","mongodb","lookup","record"})
@CapabilityDescription("Provides a lookup service based around MongoDB. Each key that is specified \nwill be added to a query as-is. For example, if you specify the two keys, \nuser and email, the resulting query will be { \"user\": \"tester\", \"email\": \"tester@test.com\" }.\nThe query is limited to the first result (findOne in the Mongo documentation). If no \"Lookup Value Field\" is specified then the entire MongoDB result document minus the _id field will be returned as a record.")
public class MongoDBLookupService
extends JsonInferenceSchemaRegistryService
implements LookupService<Object>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate MongoDBClientServicestatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate Stringprivate org.bson.Documentstatic final org.apache.nifi.components.PropertyDescriptorprivate StringFields inherited from class org.apache.nifi.serialization.SchemaRegistryService
schemaAccessStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.bson.Documentprotected List<org.apache.nifi.components.PropertyDescriptor> Class<?> private RecordSchemaloadSchema(Map<String, String> context, org.bson.Document doc) voidonEnabled(org.apache.nifi.controller.ConfigurationContext context) Methods inherited from class org.apache.nifi.serialization.JsonInferenceSchemaRegistryService
getDefaultSchemaAccessStrategy, getSchema, getSchemaAccessStrategyMethods inherited from class org.apache.nifi.serialization.SchemaRegistryService
buildSchemaTextProperty, buildStrategyProperty, customValidate, getConfigurationContext, getSchema, getSchema, getSchemaAccessStrategy, getSchemaAccessStrategyDescriptor, getSchemaAccessStrategyValues, getSuppliedSchemaFields, migrateProperties, storeSchemaAccessStrategyMethods inherited from class org.apache.nifi.controller.AbstractControllerService
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.controller.ControllerService
initialize, isStateful, migrateProperties
-
Field Details
-
LOCAL_SCHEMA_NAME
public static final org.apache.nifi.components.PropertyDescriptor LOCAL_SCHEMA_NAME -
CONTROLLER_SERVICE
public static final org.apache.nifi.components.PropertyDescriptor CONTROLLER_SERVICE -
DATABASE_NAME
public static final org.apache.nifi.components.PropertyDescriptor DATABASE_NAME -
COLLECTION_NAME
public static final org.apache.nifi.components.PropertyDescriptor COLLECTION_NAME -
LOOKUP_VALUE_FIELD
public static final org.apache.nifi.components.PropertyDescriptor LOOKUP_VALUE_FIELD -
PROJECTION
public static final org.apache.nifi.components.PropertyDescriptor PROJECTION -
lookupValueField
-
projection
private volatile org.bson.Document projection -
controllerService
-
schemaNameProperty
-
-
Constructor Details
-
MongoDBLookupService
public MongoDBLookupService()
-
-
Method Details
-
lookup
- Specified by:
lookupin interfaceLookupService<Object>- Throws:
LookupFailureException
-
lookup
public Optional<Object> lookup(Map<String, Object> coordinates, Map<String, throws LookupFailureExceptionString> context) - Specified by:
lookupin interfaceLookupService<Object>- Throws:
LookupFailureException
-
loadSchema
-
onEnabled
@OnEnabled public void onEnabled(org.apache.nifi.controller.ConfigurationContext context) - Overrides:
onEnabledin classJsonInferenceSchemaRegistryService
-
getValueType
- Specified by:
getValueTypein interfaceLookupService<Object>
-
getRequiredKeys
- Specified by:
getRequiredKeysin interfaceLookupService<Object>
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classJsonInferenceSchemaRegistryService
-
findOne
-