Class RouteOnAttribute
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
This processor routes a FlowFile based on its flow file attributes by using the Attribute Expression Language. The Expression Language is used by adding Optional Properties to the processor. The name of the Property indicates the name of the relationship to which a FlowFile will be routed if matched. The value of the Property indicates an Attribute Expression Language Expression that will be used to determine whether or not a given FlowFile will be routed to the associated relationship. If multiple expressions match a FlowFile's attributes, that FlowFile will be cloned and routed to each corresponding relationship. If none of the supplied expressions matches for a given FlowFile, that FlowFile will be routed to the 'unmatched' relationship.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate static final List<org.apache.nifi.components.PropertyDescriptor> private Map<org.apache.nifi.processor.Relationship, org.apache.nifi.components.PropertyValue> Cache of dynamic properties set duringonScheduled(ProcessContext)for quick access inonTrigger(ProcessContext, ProcessSession)static final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate final AtomicReference<Set<org.apache.nifi.processor.Relationship>> static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.AllowableValuestatic final Stringstatic final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorprivate static final Stringprivate static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.nifi.processor.Relationship> protected org.apache.nifi.components.PropertyDescriptorgetSupportedDynamicPropertyDescriptor(String propertyDescriptorName) protected List<org.apache.nifi.components.PropertyDescriptor> voidonPropertyModified(org.apache.nifi.components.PropertyDescriptor descriptor, String oldValue, String newValue) voidonScheduled(org.apache.nifi.processor.ProcessContext context) When this processor is scheduled, update the dynamic properties into the map for quick access during each onTrigger callvoidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, 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, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
ROUTE_ATTRIBUTE_KEY
- See Also:
-
routeAllMatchValue
- See Also:
-
routeAnyMatches
- See Also:
-
routePropertyNameValue
- See Also:
-
ROUTE_PROPERTY_NAME
public static final org.apache.nifi.components.AllowableValue ROUTE_PROPERTY_NAME -
ROUTE_ALL_MATCH
public static final org.apache.nifi.components.AllowableValue ROUTE_ALL_MATCH -
ROUTE_ANY_MATCHES
public static final org.apache.nifi.components.AllowableValue ROUTE_ANY_MATCHES -
ROUTE_STRATEGY
public static final org.apache.nifi.components.PropertyDescriptor ROUTE_STRATEGY -
PROPERTY_DESCRIPTORS
-
REL_NO_MATCH
public static final org.apache.nifi.processor.Relationship REL_NO_MATCH -
REL_MATCH
public static final org.apache.nifi.processor.Relationship REL_MATCH -
relationships
-
configuredRouteStrategy
-
dynamicPropertyNames
-
propertyMap
private volatile Map<org.apache.nifi.processor.Relationship,org.apache.nifi.components.PropertyValue> propertyMapCache of dynamic properties set duringonScheduled(ProcessContext)for quick access inonTrigger(ProcessContext, ProcessSession)
-
-
Constructor Details
-
RouteOnAttribute
public RouteOnAttribute()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
getSupportedDynamicPropertyDescriptor
protected org.apache.nifi.components.PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) - Overrides:
getSupportedDynamicPropertyDescriptorin classorg.apache.nifi.components.AbstractConfigurableComponent
-
onPropertyModified
public void onPropertyModified(org.apache.nifi.components.PropertyDescriptor descriptor, String oldValue, String newValue) - Specified by:
onPropertyModifiedin interfaceorg.apache.nifi.components.ConfigurableComponent- Overrides:
onPropertyModifiedin classorg.apache.nifi.components.AbstractConfigurableComponent
-
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) When this processor is scheduled, update the dynamic properties into the map for quick access during each onTrigger call- Parameters:
context- ProcessContext used to retrieve dynamic properties
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor
-