@Override public ValidationResult validate(String subject, String input, ValidationContext context) { if (context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input)) { return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build(); } return StandardValidators.NON_EMPTY_VALIDATOR.validate(subject, input, context); } }
/** * @param descriptorName to lookup the descriptor * @return a PropertyDescriptor for the name specified that is fully * populated */ @Override public final PropertyDescriptor getPropertyDescriptor(final String descriptorName) { final PropertyDescriptor specDescriptor = new PropertyDescriptor.Builder().name(descriptorName).build(); return getPropertyDescriptor(specDescriptor); }
@Override protected String getSSLProtocolForValidation(final ValidationContext validationContext) { return validationContext.getProperty(RESTRICTED_SSL_ALGORITHM).getValue(); } }
@Override public ValidationResult validate(String subject, String input, ValidationContext context) { final String connectionString = context.getProperty(CONNECTION_STRING).getValue(); try { new ConnectStringParser(connectionString); } catch (Exception e) { return new ValidationResult.Builder().subject(subject).input(input).explanation("Invalid Connect String: " + connectionString).valid(false).build(); } return new ValidationResult.Builder().subject(subject).input(input).explanation("Valid Connect String").valid(true).build(); } })
private static void validateRequiredProperty(ValidationContext context, Collection<ValidationResult> results, PropertyDescriptor property) { if (!context.getProperty(property).isSet()) { final String displayName = property.getDisplayName(); results.add(new ValidationResult.Builder() .subject(displayName) .explanation(format("'%s' is required to use '%s' listing strategy", displayName, AbstractListProcessor.BY_ENTITIES.getDisplayName())) .valid(false) .build()); } }
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { return new PropertyDescriptor.Builder() .name(propertyDescriptorName) .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) .required(false) .dynamic(true) .build(); }
@Override public ValidationResult validate(final String subject, final String input, final ValidationContext validationContext) { return new ValidationResult.Builder().subject("Property Name").input(propertyName) .explanation("Property Name must be a positive integer between 1 and the number of relationships (inclusive)") .valid(false).build(); } }
@Override public ValidationResult validate(final String subject, final String value, final ValidationContext context) { final String[] filenames = value.split(","); for (final String filename : filenames) { final ValidationResult result = StandardValidators.FILE_EXISTS_VALIDATOR.validate(subject, filename.trim(), context); if (!result.isValid()) { return result; } } return new ValidationResult.Builder().subject(subject).input(value).valid(true).build(); } }
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { return new PropertyDescriptor.Builder() .description("Specifies the value for '" + propertyDescriptorName + "' Kafka Configuration.") .name(propertyDescriptorName).addValidator(StandardValidators.NON_EMPTY_VALIDATOR).dynamic(true) .build(); }
@Override public PropertyDescriptor getPropertyDescriptor(final String propertyName) { return new PropertyDescriptor.Builder() .name(propertyName) .description(propertyName) .required(true) .sensitive(true) .build(); }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.equals(TABLE_NAME)) { lastResult = null; } }
@Override public ValidationResult validate(String subject, String input, ValidationContext context) { if (context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input)) { return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build(); } return StandardValidators.NON_EMPTY_VALIDATOR.validate(subject, input, context); } };
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { return new PropertyDescriptor.Builder() .name(propertyDescriptorName) .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) .addValidator(Validator.VALID) .required(false) .dynamic(true) .build(); }
@Override public ValidationResult validate(final String subject, final String value, final ValidationContext context) { final boolean knownValue = KafkaProcessorUtils.isStaticStringFieldNamePresent(subject, classType, CommonClientConfigs.class, SslConfigs.class, SaslConfigs.class); return new ValidationResult.Builder().subject(subject).explanation("Must be a known configuration parameter for this kafka client").valid(knownValue).build(); } };
@Override public ValidationResult validate(final String subject, final String value, final ValidationContext context) { final String[] filenames = value.split(","); for (final String filename : filenames) { final ValidationResult result = StandardValidators.FILE_EXISTS_VALIDATOR.validate(subject, filename.trim(), context); if (!result.isValid()) { return result; } } return new ValidationResult.Builder().subject(subject).input(value).valid(true).build(); } }
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) { return new PropertyDescriptor.Builder() .description("Specifies the value for '" + propertyDescriptorName + "' in the HBase configuration.") .name(propertyDescriptorName) .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .dynamic(true) .build(); }
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { return new PropertyDescriptor.Builder() .required(false) .name(propertyDescriptorName) .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .dynamic(true) .build(); }
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { return new PropertyDescriptor.Builder() .name(propertyDescriptorName) .description("Sets the environment variable '" + propertyDescriptorName + "' for the process' environment") .dynamic(true) .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .build(); }
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { return new PropertyDescriptor.Builder() .name(propertyDescriptorName) .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) .required(false) .dynamic(true) .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .build(); }
@Override protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { return new PropertyDescriptor.Builder() .name(propertyDescriptorName) .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) .addValidator(Validator.VALID) .required(false) .dynamic(true) .build(); }