@EventDriven @SideEffectFree @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"attributes","modification","update","delete","Attribute Expression Language","state"}) @CapabilityDescription(value="Updates the Attributes for a FlowFile by using the Attribute Expression Language and/or deletes the attributes based on a regular expression") @DynamicProperty(name="A FlowFile attribute to update", value="The value to set it to", supportsExpressionLanguage=true, description="Updates a FlowFile attribute specified by the Dynamic Property\'s key with the value specified by the Dynamic Property\'s value") @WritesAttribute(attribute="See additional details", description="This processor may write or remove zero or more attributes as described in additional details") @Stateful(scopes=LOCAL, description="Gives the option to store values not only on the FlowFile but as stateful variables to be referenced in a recursive manner.") public class UpdateAttribute extends AbstractProcessor implements Searchable
| Modifier and Type | Field and Description |
|---|---|
private AtomicReference<Criteria> |
criteriaCache |
private boolean |
debugEnabled |
private Map<String,Action> |
defaultActions |
static PropertyDescriptor |
DELETE_ATTRIBUTES |
static String |
DELETE_ATTRIBUTES_EXPRESSION_NAME |
private static Validator |
DELETE_PROPERTY_VALIDATOR |
static String |
DO_NOT_STORE_STATE |
private ConcurrentMap<String,PropertyValue> |
propertyValues |
static Relationship |
REL_FAILED_SET_STATE |
static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
private boolean |
stateful |
static PropertyDescriptor |
STATEFUL_VARIABLES_INIT_VALUE |
static String |
STATEFUL_VARIABLES_INIT_VALUE_NAME |
private static Set<Relationship> |
statefulRelationshipSet |
private static Set<Relationship> |
statelessRelationshipSet |
static PropertyDescriptor |
STORE_STATE |
static String |
STORE_STATE_LOCALLY |
static String |
STORE_STATE_NAME |
| Constructor and Description |
|---|
UpdateAttribute() |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, validatepublic static final String DO_NOT_STORE_STATE
public static final String STORE_STATE_LOCALLY
private final AtomicReference<Criteria> criteriaCache
private final ConcurrentMap<String,PropertyValue> propertyValues
private static final Set<Relationship> statelessRelationshipSet
private static final Set<Relationship> statefulRelationshipSet
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILED_SET_STATE
private volatile Set<Relationship> relationships
private static final Validator DELETE_PROPERTY_VALIDATOR
public static final String DELETE_ATTRIBUTES_EXPRESSION_NAME
public static final PropertyDescriptor DELETE_ATTRIBUTES
public static final String STORE_STATE_NAME
public static final PropertyDescriptor STORE_STATE
public static final String STATEFUL_VARIABLES_INIT_VALUE_NAME
public static final PropertyDescriptor STATEFUL_VARIABLES_INIT_VALUE
private volatile boolean debugEnabled
private volatile boolean stateful
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentprotected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor in class AbstractConfigurableComponentpublic void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue)
onPropertyModified in interface ConfigurableComponentonPropertyModified in class AbstractConfigurableComponent@OnScheduled public void onScheduled(ProcessContext context) throws IOException
IOExceptionprotected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate in class AbstractConfigurableComponentpublic Collection<SearchResult> search(SearchContext context)
search in interface Searchablepublic void onTrigger(ProcessContext context, ProcessSession session)
onTrigger in class AbstractProcessorprivate boolean evaluateCriteria(ProcessSession session, ProcessContext context, Criteria criteria, FlowFile flowfile, Map<FlowFile,List<Rule>> matchedRules, Map<String,String> statefulAttributes)
private boolean evaluateRule(ProcessContext context, Rule rule, FlowFile flowfile, Map<String,String> statefulAttributes)
private PropertyValue getPropertyValue(String text, ProcessContext context)
private boolean evaluateCondition(ProcessContext context, Condition condition, FlowFile flowfile, Map<String,String> statefulAttributes)
private FlowFile executeActions(ProcessSession session, ProcessContext context, List<Rule> rules, Map<String,Action> defaultActions, FlowFile flowfile, Map<String,String> stateInitialAttributes, Map<String,String> stateWorkingAttributes)
Copyright © 2018 Apache NiFi Project. All rights reserved.