@Tags(value={"record","record sink","script","invoke","groovy","python","jython","jruby","ruby","javascript","js","lua","luaj"}) @CapabilityDescription(value="Allows the user to provide a scripted RecordSinkService instance in order to transmit records to the desired target. The script must set a variable \'recordSink\' to an implementation of RecordSinkService.") @Restricted(restrictions=@Restriction(requiredPermission=EXECUTE_CODE,explanation="Provides operator the ability to execute arbitrary code assuming all permissions that NiFi has.")) public class ScriptedRecordSink extends AbstractScriptedControllerService implements RecordSinkService
| Modifier and Type | Field and Description |
|---|---|
protected AtomicReference<RecordSinkService> |
recordSink |
configurationContext, scriptEngine, scriptingComponentHelper, scriptNeedsReload, validationResultsRECORD_WRITER_FACTORY| Constructor and Description |
|---|
ScriptedRecordSink() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
Returns a PropertyDescriptor for the given name.
|
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Returns a list of property descriptors supported by this processor.
|
void |
onEnabled(ConfigurationContext context) |
protected boolean |
reloadScript(String scriptBody)
Reloads the script RecordSinkService.
|
void |
reset() |
WriteResult |
sendData(RecordSet recordSet,
Map<String,String> attributes,
boolean sendZeroResults) |
void |
setup() |
onPropertyModified, reloadScriptBody, reloadScriptFileabstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitinitializegetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprotected final AtomicReference<RecordSinkService> recordSink
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractScriptedControllerServiceprotected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor in class AbstractScriptedControllerServicepropertyDescriptorName - used to lookup if any property descriptors exist for that nameprotected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractScriptedControllerServicepublic void setup()
setup in class AbstractScriptedControllerServiceprotected boolean reloadScript(String scriptBody)
reloadScript in class AbstractScriptedControllerServicescriptBody - An input stream associated with the script content@OnEnabled public void onEnabled(ConfigurationContext context)
onEnabled in class AbstractScriptedControllerServicepublic WriteResult sendData(RecordSet recordSet, Map<String,String> attributes, boolean sendZeroResults) throws IOException
sendData in interface RecordSinkServiceIOExceptionpublic void reset()
reset in interface RecordSinkServiceCopyright © 2021 Apache NiFi Project. All rights reserved.