@Test public void testCreateDynamicProcessorPropertyWhenSupported() { final String propertyName = "FOO"; final org.apache.nifi.registry.flow.Bundle bundle = getRequestBundle(systemBundle); final PropertyDescriptor dynamicProperty = extensionManager.createDynamicProcessorPropertyDescriptor( dynamicPropsProcessor.getType(), bundle, propertyName); assertNotNull(dynamicProperty); assertEquals(propertyName, dynamicProperty.getName()); assertEquals(propertyName, dynamicProperty.getDisplayName()); }
@Override public PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName) { final ProcessorDefinition manifestProcessor = locateManifestProcessor(type, bundle); if (!manifestProcessor.getSupportsDynamicProperties()) { throw new IllegalStateException("Processor does not support dynamic properties"); } final PropertyDescriptor propertyDescriptor = new PropertyDescriptor(); propertyDescriptor.setName(propertyName); propertyDescriptor.setDisplayName(propertyName); propertyDescriptor.setExpressionLanguageScope(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES); propertyDescriptor.setDescription("Dynamic property"); propertyDescriptor.setRequired(false); propertyDescriptor.setDynamic(true); return propertyDescriptor; }
StandardFDExtensionManager implements FDExtensionManager { @Override public PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName) { final ProcessorDefinition manifestProcessor = locateManifestProcessor(type, bundle); if (!manifestProcessor.getSupportsDynamicProperties()) { throw new IllegalStateException("Processor does not support dynamic properties"); } final PropertyDescriptor propertyDescriptor = new PropertyDescriptor(); propertyDescriptor.setName(propertyName); propertyDescriptor.setDisplayName(propertyName); propertyDescriptor.setExpressionLanguageScope(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES); propertyDescriptor.setDescription("Dynamic property"); propertyDescriptor.setRequired(false); propertyDescriptor.setDynamic(true); return propertyDescriptor; } }
StandardFDExtensionManager implements FDExtensionManager { @Override public PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName) { final ProcessorDefinition manifestProcessor = locateManifestProcessor(type, bundle); if (!manifestProcessor.getSupportsDynamicProperties()) { throw new IllegalStateException("Processor does not support dynamic properties"); } final PropertyDescriptor propertyDescriptor = new PropertyDescriptor(); propertyDescriptor.setName(propertyName); propertyDescriptor.setDisplayName(propertyName); propertyDescriptor.setExpressionLanguageScope(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES); propertyDescriptor.setDescription("Dynamic property"); propertyDescriptor.setRequired(false); propertyDescriptor.setDynamic(true); return propertyDescriptor; } StandardFDExtensionManager(final AgentManifest agentManifest); }
StandardFDExtensionManager implements FDExtensionManager { @Override public PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName) { final ProcessorDefinition manifestProcessor = locateManifestProcessor(type, bundle); if (!manifestProcessor.getSupportsDynamicProperties()) { throw new IllegalStateException("Processor does not support dynamic properties"); } final PropertyDescriptor propertyDescriptor = new PropertyDescriptor(); propertyDescriptor.setName(propertyName); propertyDescriptor.setDisplayName(propertyName); propertyDescriptor.setExpressionLanguageScope(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES); propertyDescriptor.setDescription("Dynamic property"); propertyDescriptor.setRequired(false); propertyDescriptor.setDynamic(true); return propertyDescriptor; } StandardFDExtensionManager(final AgentManifest agentManifest); @Override Set<FDComponentType> getProcessorTypes(); @Override ProcessorDefinition getProcessorDefinition(final String type, final Bundle bundle); @Override FDProcessor createProcessor(final String type, final Bundle bundle); @Override Optional<PropertyDescriptor> getProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override Set<FDComponentType> getControllerServiceTypes(); @Override ControllerServiceDefinition getControllerServiceDefinition(final String type, final Bundle bundle); @Override FDControllerService createControllerService(final String type, final Bundle bundle); @Override Optional<PropertyDescriptor> getControllerServicePropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override PropertyDescriptor createDynamicControllerServicePropertyDescriptor(final String type, final Bundle bundle, final String propertyName); }
StandardFDExtensionManager implements FDExtensionManager { @Override public PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName) { final ProcessorDefinition manifestProcessor = locateManifestProcessor(type, bundle); if (!manifestProcessor.getSupportsDynamicProperties()) { throw new IllegalStateException("Processor does not support dynamic properties"); } final PropertyDescriptor propertyDescriptor = new PropertyDescriptor(); propertyDescriptor.setName(propertyName); propertyDescriptor.setDisplayName(propertyName); propertyDescriptor.setExpressionLanguageScope(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES); propertyDescriptor.setDescription("Dynamic property"); propertyDescriptor.setRequired(false); propertyDescriptor.setDynamic(true); return propertyDescriptor; } StandardFDExtensionManager(final AgentManifest agentManifest); @Override Set<FDComponentType> getProcessorTypes(); @Override ProcessorDefinition getProcessorDefinition(final String type, final Bundle bundle); @Override FDProcessor createProcessor(final String type, final Bundle bundle); @Override Optional<PropertyDescriptor> getProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override Set<FDComponentType> getControllerServiceTypes(); @Override ControllerServiceDefinition getControllerServiceDefinition(final String type, final Bundle bundle); @Override FDControllerService createControllerService(final String type, final Bundle bundle); @Override Optional<PropertyDescriptor> getControllerServicePropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override PropertyDescriptor createDynamicControllerServicePropertyDescriptor(final String type, final Bundle bundle, final String propertyName);  }