Search in sources :

Example 1 with SchemaAccessStrategy

use of org.apache.nifi.schema.access.SchemaAccessStrategy in project nifi by apache.

the class SchemaRegistryService method getSuppliedSchemaFields.

protected Set<SchemaField> getSuppliedSchemaFields(final ValidationContext validationContext) {
    final String accessStrategyValue = validationContext.getProperty(getSchemaAcessStrategyDescriptor()).getValue();
    final SchemaRegistry schemaRegistry = validationContext.getProperty(SCHEMA_REGISTRY).asControllerService(SchemaRegistry.class);
    final SchemaAccessStrategy accessStrategy = getSchemaAccessStrategy(accessStrategyValue, schemaRegistry, validationContext);
    if (accessStrategy == null) {
        return EnumSet.noneOf(SchemaField.class);
    }
    final Set<SchemaField> suppliedFields = accessStrategy.getSuppliedSchemaFields();
    return suppliedFields;
}
Also used : SchemaField(org.apache.nifi.schema.access.SchemaField) SchemaAccessStrategy(org.apache.nifi.schema.access.SchemaAccessStrategy) SchemaRegistry(org.apache.nifi.schemaregistry.services.SchemaRegistry)

Aggregations

SchemaAccessStrategy (org.apache.nifi.schema.access.SchemaAccessStrategy)1 SchemaField (org.apache.nifi.schema.access.SchemaField)1 SchemaRegistry (org.apache.nifi.schemaregistry.services.SchemaRegistry)1