/** * This method is intended to be overridden by SubClasses those do not support TARGET_SYSTEM_TIMESTAMP_PRECISION property. * So that it use return different precisions than PRECISION_AUTO_DETECT. * If TARGET_SYSTEM_TIMESTAMP_PRECISION is supported as a valid Processor property, * then PRECISION_AUTO_DETECT will be the default value when not specified by a user. * @return */ protected String getDefaultTimePrecision() { return TARGET_SYSTEM_TIMESTAMP_PRECISION.getDefaultValue(); }
public String getProperty(final PropertyDescriptor descriptor) { final String value = properties.get(descriptor); if (value == null) { return descriptor.getDefaultValue(); } else { return value; } }
@Override public PropertyValue getProperty(final PropertyDescriptor property) { final String configuredValue = properties.get(property); return new StandardPropertyValue(configuredValue == null ? property.getDefaultValue() : configuredValue, controllerServiceProvider, preparedQueries.get(property), variableRegistry); }
@Override public PropertyValue getProperty(final PropertyDescriptor property) { final String configuredValue = properties.get(property); return new MockPropertyValue(configuredValue == null ? property.getDefaultValue() : configuredValue, this, variableRegistry); }
public boolean removeProperty(final String property) { Objects.requireNonNull(property); final PropertyDescriptor fullyPopulatedDescriptor = component.getPropertyDescriptor(property); String value = null; if ((value = properties.remove(fullyPopulatedDescriptor)) != null) { if (!value.equals(fullyPopulatedDescriptor.getDefaultValue())) { component.onPropertyModified(fullyPopulatedDescriptor, value, null); } return true; } return false; }
@Override public PropertyValue getProperty(final PropertyDescriptor property) { final String configuredValue = component.getProperty(property); return new StandardPropertyValue(configuredValue == null ? property.getDefaultValue() : configuredValue, serviceLookup, preparedQueries.get(property), variableRegistry); }
@Override public PropertyValue getProperty(final String propertyName) { final PropertyDescriptor descriptor = component.getPropertyDescriptor(propertyName); if (descriptor == null) { return null; } final String setPropertyValue = properties.get(descriptor); final String propValue = (setPropertyValue == null) ? descriptor.getDefaultValue() : setPropertyValue; return new MockPropertyValue(propValue, this, variableRegistry, (enableExpressionValidation && allowExpressionValidation) ? descriptor : null); }
@Override public PropertyValue getProperty(final PropertyDescriptor property) { String value = properties.get(property); if (value == null) { value = getActualDescriptor(property).getDefaultValue(); } return new MockPropertyValue(value, serviceLookup, variableRegistry); }
@Override public PropertyValue getProperty(final PropertyDescriptor descriptor) { final String propName = descriptor.getName(); String value = propertyValues.get(propName); if (value == null) { value = descriptor.getDefaultValue(); } return new StandardPropertyValue(value, null, variableRegistry); }
private List<VariableImpact> getVariableImpact(final ComponentNode component) { return component.getProperties().keySet().stream() .map(descriptor -> { final String configuredVal = component.getProperty(descriptor); return configuredVal == null ? descriptor.getDefaultValue() : configuredVal; }) .map(propVal -> Query.prepare(propVal).getVariableImpact()) .collect(Collectors.toList()); }
@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); }
@Override public PropertyValue getProperty(PropertyDescriptor property) { final String configuredValue = processorNode.getProperty(property); return new StandardPropertyValue(configuredValue == null ? property.getDefaultValue() : configuredValue, controllerServiceLookup,variableRegistry); }
private void initializeSignerOverride(final ProcessContext context, final ClientConfiguration config) { String signer = context.getProperty(SIGNER_OVERRIDE).getValue(); if (signer != null && !signer.equals(SIGNER_OVERRIDE.getDefaultValue())) { config.setSignerOverride(signer); } }
@Override public Map<PropertyDescriptor, String> getProperties() { final Map<PropertyDescriptor, String> props = new HashMap<>(); final Map<String, String> configuredProps = config.getProperties(); final NotificationService service = config.getService(); final List<PropertyDescriptor> configuredPropertyDescriptors = new ArrayList<>(service.getPropertyDescriptors()); // This is needed to capture all dynamic properties configuredProps.forEach((key, value) -> { PropertyDescriptor propertyDescriptor = config.service.getPropertyDescriptor(key); props.put(config.service.getPropertyDescriptor(key), value); configuredPropertyDescriptors.remove(propertyDescriptor); }); for (final PropertyDescriptor descriptor : configuredPropertyDescriptors) { props.put(descriptor, descriptor.getDefaultValue()); } return props; } };
@Override public PropertyValue getProperty(final PropertyDescriptor descriptor) { verifyTaskActive(); final String setPropertyValue = properties.get(descriptor); if (setPropertyValue != null) { return new StandardPropertyValue(setPropertyValue, this, preparedQueries.get(descriptor), procNode.getVariableRegistry()); } // Get the "canonical" Property Descriptor from the Processor final PropertyDescriptor canonicalDescriptor = procNode.getProcessor().getPropertyDescriptor(descriptor.getName()); final String defaultValue = canonicalDescriptor.getDefaultValue(); return new StandardPropertyValue(defaultValue, this, preparedQueries.get(descriptor), procNode.getVariableRegistry()); }
/** * <p> * Returns the currently configured value for the property with the given name. * </p> */ @Override public PropertyValue getProperty(final String propertyName) { verifyTaskActive(); final Processor processor = procNode.getProcessor(); final PropertyDescriptor descriptor = processor.getPropertyDescriptor(propertyName); if (descriptor == null) { return null; } final String setPropertyValue = properties.get(descriptor); final String propValue = (setPropertyValue == null) ? descriptor.getDefaultValue() : setPropertyValue; return new StandardPropertyValue(propValue, this, preparedQueries.get(descriptor), procNode.getVariableRegistry()); }
@Override public PropertyValue getProperty(final PropertyDescriptor descriptor) { final PropertyDescriptor fullPropDescriptor = config.getService().getPropertyDescriptor(descriptor.getName()); if (fullPropDescriptor == null) { return null; } String configuredValue = config.getProperties().get(fullPropDescriptor.getName()); if (configuredValue == null) { configuredValue = fullPropDescriptor.getDefaultValue(); } return new StandardPropertyValue(configuredValue, null, variableRegistry); }
@OnScheduled public void setup(final ConfigurationContext context) { metricsService = getMetricsService(); ddMetricRegistryBuilder = getMetricRegistryBuilder(); metricRegistry = getMetricRegistry(); metricsMap = getMetricsMap(); metricsPrefix = METRICS_PREFIX.getDefaultValue(); environment = ENVIRONMENT.getDefaultValue(); virtualMachineMetrics = VirtualMachineMetrics.getInstance(); ddMetricRegistryBuilder.setMetricRegistry(metricRegistry) .setTags(metricsService.getAllTagsList()); }
@Test public void testDecryptShouldDefaultToBcrypt() throws IOException { // Arrange final TestRunner testRunner = TestRunners.newTestRunner(new EncryptContent()); // Assert Assert.assertEquals("Decrypt should default to Legacy KDF", testRunner.getProcessor().getPropertyDescriptor(EncryptContent.KEY_DERIVATION_FUNCTION .getName()).getDefaultValue(), KeyDerivationFunction.BCRYPT.name()); }
private void writeProperty(final PropertyDescriptor property) throws IOException { writeStartElement("property"); writeTextElement("name", property.getName()); writeTextElement("displayName", property.getDisplayName()); writeTextElement("description", property.getDescription()); writeTextElement("defaultValue", property.getDefaultValue()); writeTextElement("controllerServiceDefinition", property.getControllerServiceDefinition() == null ? null : property.getControllerServiceDefinition().getName()); writeTextArray("allowableValues", "allowableValue", property.getAllowableValues(), AllowableValue::getDisplayName); writeBooleanElement("required", property.isRequired()); writeBooleanElement("sensitive", property.isSensitive()); writeBooleanElement("expressionLanguageSupported", property.isExpressionLanguageSupported()); writeTextElement("expressionLanguageScope", property.getExpressionLanguageScope() == null ? null : property.getExpressionLanguageScope().name()); writeBooleanElement("dynamicallyModifiesClasspath", property.isDynamicClasspathModifier()); writeBooleanElement("dynamic", property.isDynamic()); writeEndElement(); }