Search in sources :

Example 1 with FlowSnippetDTOEnricher

use of org.apache.nifi.minifi.toolkit.configuration.dto.FlowSnippetDTOEnricher in project nifi-minifi by apache.

the class ConfigMain method transformTemplateToSchema.

public static ConfigSchema transformTemplateToSchema(InputStream source) throws JAXBException, IOException {
    try {
        TemplateDTO templateDTO = (TemplateDTO) JAXBContext.newInstance(TemplateDTO.class).createUnmarshaller().unmarshal(source);
        FlowSnippetDTOEnricher enricher = new FlowSnippetDTOEnricher();
        enricher.enrich(templateDTO.getSnippet(), templateDTO.getEncodingVersion());
        ConfigSchema configSchema = new ConfigSchemaFunction().apply(templateDTO);
        return configSchema;
    } finally {
        source.close();
    }
}
Also used : NiFiRegConfigSchemaFunction(org.apache.nifi.minifi.toolkit.configuration.registry.NiFiRegConfigSchemaFunction) ConfigSchemaFunction(org.apache.nifi.minifi.toolkit.configuration.dto.ConfigSchemaFunction) FlowSnippetDTOEnricher(org.apache.nifi.minifi.toolkit.configuration.dto.FlowSnippetDTOEnricher) TemplateDTO(org.apache.nifi.web.api.dto.TemplateDTO) ConfigSchema(org.apache.nifi.minifi.commons.schema.ConfigSchema)

Aggregations

ConfigSchema (org.apache.nifi.minifi.commons.schema.ConfigSchema)1 ConfigSchemaFunction (org.apache.nifi.minifi.toolkit.configuration.dto.ConfigSchemaFunction)1 FlowSnippetDTOEnricher (org.apache.nifi.minifi.toolkit.configuration.dto.FlowSnippetDTOEnricher)1 NiFiRegConfigSchemaFunction (org.apache.nifi.minifi.toolkit.configuration.registry.NiFiRegConfigSchemaFunction)1 TemplateDTO (org.apache.nifi.web.api.dto.TemplateDTO)1