@EventDriven @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"command execution","command","stream","execute"}) @CapabilityDescription(value="Executes an external command on the contents of a flow file, and creates a new flow file with the results of the command.") @DynamicProperty(name="An environment variable name", value="An environment variable value", description="These environment variables are passed to the process spawned by this Processor") @WritesAttributes(value={@WritesAttribute(attribute="execution.command",description="The name of the command executed"),@WritesAttribute(attribute="execution.command.args",description="The semi-colon delimited list of arguments"),@WritesAttribute(attribute="execution.status",description="The exit status code returned from executing the command"),@WritesAttribute(attribute="execution.error",description="Any error messages returned from executing the command")}) public class ExecuteStreamCommand extends AbstractProcessor
This processor executes an external command on the contents of a flow file, and creates a new flow file with the results of the command.
Properties:
Relationships:
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ExecuteStreamCommand.ProcessStreamWriterCallback |
Modifier and Type | Field and Description |
---|---|
(package private) static PropertyDescriptor |
ARG_DELIMITER |
private static Validator |
ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR |
private static Set<Relationship> |
ATTRIBUTE_RELATIONSHIP_SET |
private static Validator |
characterValidator |
(package private) static PropertyDescriptor |
EXECUTION_ARGUMENTS |
(package private) static PropertyDescriptor |
EXECUTION_COMMAND |
(package private) static PropertyDescriptor |
IGNORE_STDIN |
private ProcessorLog |
logger |
static Relationship |
ORIGINAL_RELATIONSHIP |
static Relationship |
OUTPUT_STREAM_RELATIONSHIP |
private static Set<Relationship> |
OUTPUT_STREAM_RELATIONSHIP_SET |
private static List<PropertyDescriptor> |
PROPERTIES |
(package private) static PropertyDescriptor |
PUT_ATTRIBUTE_MAX_LENGTH |
(package private) static PropertyDescriptor |
PUT_OUTPUT_IN_ATTRIBUTE |
private AtomicReference<Set<Relationship>> |
relationships |
(package private) static PropertyDescriptor |
WORKING_DIR |
Constructor and Description |
---|
ExecuteStreamCommand() |
Modifier and Type | Method and Description |
---|---|
Set<Relationship> |
getRelationships() |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onPropertyModified(PropertyDescriptor descriptor,
String oldValue,
String newValue) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
private static void |
readStdoutReadable(boolean ignoreStdin,
OutputStream stdinWritable,
ProcessorLog logger,
InputStream incomingFlowFileIS) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, validate
public static final Relationship ORIGINAL_RELATIONSHIP
public static final Relationship OUTPUT_STREAM_RELATIONSHIP
private AtomicReference<Set<Relationship>> relationships
private static final Set<Relationship> OUTPUT_STREAM_RELATIONSHIP_SET
private static final Set<Relationship> ATTRIBUTE_RELATIONSHIP_SET
private static final Validator ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR
static final PropertyDescriptor EXECUTION_COMMAND
static final PropertyDescriptor EXECUTION_ARGUMENTS
static final PropertyDescriptor WORKING_DIR
static final PropertyDescriptor IGNORE_STDIN
static final PropertyDescriptor PUT_OUTPUT_IN_ATTRIBUTE
static final PropertyDescriptor PUT_ATTRIBUTE_MAX_LENGTH
private static final Validator characterValidator
static final PropertyDescriptor ARG_DELIMITER
private static final List<PropertyDescriptor> PROPERTIES
private ProcessorLog logger
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue)
onPropertyModified
in interface ConfigurableComponent
onPropertyModified
in class AbstractConfigurableComponent
public List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor
in class AbstractConfigurableComponent
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
private static void readStdoutReadable(boolean ignoreStdin, OutputStream stdinWritable, ProcessorLog logger, InputStream incomingFlowFileIS) throws IOException
IOException
Copyright © 2016 Apache NiFi Project. All rights reserved.