@EventDriven @SideEffectFree @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"lookup","cache","enrich","join","attributes","Attribute Expression Language"}) @CapabilityDescription(value="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
Modifier and Type | Field and Description |
---|---|
private List<PropertyDescriptor> |
descriptors |
private Map<PropertyDescriptor,PropertyValue> |
dynamicProperties |
static PropertyDescriptor |
INCLUDE_EMPTY_VALUES |
static PropertyDescriptor |
LOOKUP_SERVICE |
static Relationship |
REL_FAILURE |
static Relationship |
REL_MATCHED |
static Relationship |
REL_UNMATCHED |
private Set<Relationship> |
relationships |
Constructor and Description |
---|
LookupAttribute() |
Modifier and Type | Method and Description |
---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
Set<Relationship> |
getRelationships() |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
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) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final PropertyDescriptor LOOKUP_SERVICE
public static final PropertyDescriptor INCLUDE_EMPTY_VALUES
public static final Relationship REL_MATCHED
public static final Relationship REL_UNMATCHED
public static final Relationship REL_FAILURE
private List<PropertyDescriptor> descriptors
private Set<Relationship> relationships
private Map<PropertyDescriptor,PropertyValue> dynamicProperties
protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate
in class AbstractConfigurableComponent
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor
in class AbstractConfigurableComponent
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
@OnScheduled public void onScheduled(ProcessContext context)
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
private void onTrigger(ComponentLog logger, LookupService lookupService, boolean includeEmptyValues, FlowFile flowFile, ProcessSession session) throws ProcessException, IOException
ProcessException
IOException
Copyright © 2021 Apache NiFi Project. All rights reserved.