Class LookupAttribute
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.LookupAttribute
- All Implemented Interfaces:
ConfigurableComponent
,Processor
@SideEffectFree
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@Tags({"lookup","cache","enrich","join","attributes","Attribute Expression Language"})
@CapabilityDescription("Lookup attributes from a lookup service")
@DynamicProperty(name="The name of the attribute to add to the FlowFile",
value="The name of the key or property to retrieve from the lookup service",
expressionLanguageScope=FLOWFILE_ATTRIBUTES,
description="Adds a FlowFile attribute specified by the dynamic property\'s key with the value found in the lookup service using the the dynamic property\'s value")
public class LookupAttribute
extends AbstractProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
<PropertyDescriptor> private Map
<PropertyDescriptor, PropertyValue> static final PropertyDescriptor
static final PropertyDescriptor
static final Relationship
static final Relationship
static final Relationship
private Set
<Relationship> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
<ValidationResult> customValidate
(ValidationContext validationContext) protected PropertyDescriptor
getSupportedDynamicPropertyDescriptor
(String propertyDescriptorName) protected List
<PropertyDescriptor> protected void
init
(ProcessorInitializationContext context) void
onScheduled
(ProcessContext context) private void
onTrigger
(ComponentLog logger, LookupService lookupService, boolean includeEmptyValues, FlowFile flowFile, ProcessSession session) void
onTrigger
(ProcessContext context, ProcessSession session) private boolean
putAttribute
(String attributeName, Optional<String> attributeValue, Map<String, String> attributes, boolean includeEmptyValues, ComponentLog logger) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTrigger
Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, 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
-
LOOKUP_SERVICE
-
INCLUDE_EMPTY_VALUES
-
REL_MATCHED
-
REL_UNMATCHED
-
REL_FAILURE
-
descriptors
-
relationships
-
dynamicProperties
-
-
Constructor Details
-
LookupAttribute
public LookupAttribute()
-
-
Method Details
-
customValidate
- Overrides:
customValidate
in classAbstractConfigurableComponent
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptors
in classAbstractConfigurableComponent
-
getSupportedDynamicPropertyDescriptor
- Overrides:
getSupportedDynamicPropertyDescriptor
in classAbstractConfigurableComponent
-
getRelationships
- Specified by:
getRelationships
in interfaceProcessor
- Overrides:
getRelationships
in classAbstractSessionFactoryProcessor
-
init
- Overrides:
init
in classAbstractSessionFactoryProcessor
-
onScheduled
-
onTrigger
- Specified by:
onTrigger
in classAbstractProcessor
- Throws:
ProcessException
-
onTrigger
private void onTrigger(ComponentLog logger, LookupService lookupService, boolean includeEmptyValues, FlowFile flowFile, ProcessSession session) throws ProcessException, IOException - Throws:
ProcessException
IOException
-
putAttribute
-