@Test public void testGetPropertyReportingTask() throws ReportingTaskInstantiationException { ReportingTaskNode reportingTask = controller.createReportingTask(DummyScheduledReportingTask.class.getName(), systemBundle.getBundleDetails().getCoordinate()); PropertyDescriptor TEST_WITHOUT_DEFAULT_VALUE = new PropertyDescriptor.Builder().name("Test without default value").build(); PropertyDescriptor TEST_WITH_DEFAULT_VALUE = new PropertyDescriptor.Builder().name("Test with default value").build(); PropertyValue defaultValue = reportingTask.getReportingContext().getProperty(TEST_WITH_DEFAULT_VALUE); assertEquals("nifi", defaultValue.getValue()); PropertyValue value = reportingTask.getReportingContext().getProperty(TEST_WITHOUT_DEFAULT_VALUE); assertEquals(null, value.getValue()); }
@Override public PropertyValue getProperty(final PropertyDescriptor property) { final PropertyDescriptor descriptor = reportingTask.getPropertyDescriptor(property.getName()); if (descriptor == null) { return null; } final String configuredValue = properties.get(property); return new StandardPropertyValue(configuredValue == null ? descriptor.getDefaultValue() : configuredValue, this, preparedQueries.get(property), variableRegistry); }
StandardReportingContext implements ReportingContext, ControllerServiceLookup { @Override public PropertyValue getProperty(final PropertyDescriptor property) { final PropertyDescriptor descriptor = reportingTask.getPropertyDescriptor(property.getName()); if (descriptor == null) { return null; } final String configuredValue = properties.get(property); return new StandardPropertyValue(configuredValue == null ? descriptor.getDefaultValue() : configuredValue, this, preparedQueries.get(property), variableRegistry); } }
StandardReportingContext implements ReportingContext, ControllerServiceLookup { @Override public PropertyValue getProperty(final PropertyDescriptor property) { final PropertyDescriptor descriptor = reportingTask.getPropertyDescriptor(property.getName()); if (descriptor == null) { return null; } final String configuredValue = properties.get(property); return new StandardPropertyValue(configuredValue == null ? descriptor.getDefaultValue() : configuredValue, this, preparedQueries.get(property), variableRegistry); } StandardReportingContext(final FlowController flowController, final BulletinRepository bulletinRepository,
                                    final Map<PropertyDescriptor, String> properties, final ControllerServiceProvider serviceProvider, final ReportingTask reportingTask,
                                    final VariableRegistry variableRegistry); }
StandardReportingContext implements ReportingContext, ControllerServiceLookup { @Override public PropertyValue getProperty(final PropertyDescriptor property) { final PropertyDescriptor descriptor = reportingTask.getPropertyDescriptor(property.getName()); if (descriptor == null) { return null; } final String configuredValue = properties.get(property); return new StandardPropertyValue(configuredValue == null ? descriptor.getDefaultValue() : configuredValue, this, preparedQueries.get(property), variableRegistry); } StandardReportingContext(final FlowController flowController, final BulletinRepository bulletinRepository,
                                    final Map<PropertyDescriptor, String> properties, final ControllerServiceProvider serviceProvider, final ReportingTask reportingTask,
                                    final VariableRegistry variableRegistry); @Override EventAccess getEventAccess(); @Override BulletinRepository getBulletinRepository(); @Override Bulletin createBulletin(final String category, final Severity severity, final String message); @Override Bulletin createBulletin(final String componentId, final String category, final Severity severity, final String message); @Override Map<PropertyDescriptor, String> getProperties(); @Override Map<String, String> getAllProperties(); @Override PropertyValue getProperty(final PropertyDescriptor property); @Override ControllerService getControllerService(final String serviceIdentifier); @Override Set<String> getControllerServiceIdentifiers(final Class<? extends ControllerService> serviceType); @Override boolean isControllerServiceEnabled(final ControllerService service); @Override boolean isControllerServiceEnabled(final String serviceIdentifier); @Override boolean isControllerServiceEnabling(final String serviceIdentifier); @Override ControllerServiceLookup getControllerServiceLookup(); @Override String getControllerServiceName(final String serviceIdentifier); @Override StateManager getStateManager(); @Override boolean isClustered(); @Override String getClusterNodeIdentifier(); }
StandardReportingContext implements ReportingContext, ControllerServiceLookup { @Override public PropertyValue getProperty(final PropertyDescriptor property) { final PropertyDescriptor descriptor = reportingTask.getPropertyDescriptor(property.getName()); if (descriptor == null) { return null; } final String configuredValue = properties.get(property); return new StandardPropertyValue(configuredValue == null ? descriptor.getDefaultValue() : configuredValue, this, preparedQueries.get(property), variableRegistry); } StandardReportingContext(final FlowController flowController, final BulletinRepository bulletinRepository,
                                    final Map<PropertyDescriptor, String> properties, final ControllerServiceProvider serviceProvider, final ReportingTask reportingTask,
                                    final VariableRegistry variableRegistry); @Override EventAccess getEventAccess(); @Override BulletinRepository getBulletinRepository(); @Override Bulletin createBulletin(final String category, final Severity severity, final String message); @Override Bulletin createBulletin(final String componentId, final String category, final Severity severity, final String message); @Override Map<PropertyDescriptor, String> getProperties(); @Override Map<String, String> getAllProperties(); @Override PropertyValue getProperty(final PropertyDescriptor property); @Override ControllerService getControllerService(final String serviceIdentifier); @Override Set<String> getControllerServiceIdentifiers(final Class<? extends ControllerService> serviceType); @Override boolean isControllerServiceEnabled(final ControllerService service); @Override boolean isControllerServiceEnabled(final String serviceIdentifier); @Override boolean isControllerServiceEnabling(final String serviceIdentifier); @Override ControllerServiceLookup getControllerServiceLookup(); @Override String getControllerServiceName(final String serviceIdentifier); @Override StateManager getStateManager(); @Override boolean isClustered(); @Override String getClusterNodeIdentifier();  }