Search in sources :

Example 1 with FunnelSchema

use of org.apache.nifi.minifi.commons.schema.FunnelSchema in project nifi-minifi by apache.

the class ConfigTransformer method addProcessGroup.

protected static void addProcessGroup(Document doc, Element element, ProcessGroupSchema processGroupSchema, ParentGroupIdResolver parentGroupIdResolver) throws ConfigurationChangeException {
    try {
        String processGroupId = processGroupSchema.getId();
        addTextElement(element, "id", processGroupId);
        addTextElement(element, "name", processGroupSchema.getName());
        addPosition(element);
        addTextElement(element, "comment", processGroupSchema.getComment());
        for (ProcessorSchema processorConfig : processGroupSchema.getProcessors()) {
            addProcessor(element, processorConfig);
        }
        for (PortSchema portSchema : processGroupSchema.getInputPortSchemas()) {
            addPort(doc, element, portSchema, "inputPort");
        }
        for (PortSchema portSchema : processGroupSchema.getOutputPortSchemas()) {
            addPort(doc, element, portSchema, "outputPort");
        }
        for (FunnelSchema funnelSchema : processGroupSchema.getFunnels()) {
            addFunnel(element, funnelSchema);
        }
        for (ProcessGroupSchema child : processGroupSchema.getProcessGroupSchemas()) {
            Element processGroups = doc.createElement("processGroup");
            element.appendChild(processGroups);
            addProcessGroup(doc, processGroups, child, parentGroupIdResolver);
        }
        for (RemoteProcessGroupSchema remoteProcessGroupSchema : processGroupSchema.getRemoteProcessGroups()) {
            addRemoteProcessGroup(element, remoteProcessGroupSchema);
        }
        for (ConnectionSchema connectionConfig : processGroupSchema.getConnections()) {
            addConnection(element, connectionConfig, parentGroupIdResolver);
        }
        for (ControllerServiceSchema controllerServiceSchema : processGroupSchema.getControllerServices()) {
            addControllerService(element, controllerServiceSchema);
        }
    } catch (ConfigurationChangeException e) {
        throw e;
    } catch (Exception e) {
        throw new ConfigurationChangeException("Failed to parse the config YAML while trying to creating the root Process Group", e);
    }
}
Also used : ConnectionSchema(org.apache.nifi.minifi.commons.schema.ConnectionSchema) RemoteProcessGroupSchema(org.apache.nifi.minifi.commons.schema.RemoteProcessGroupSchema) ProcessGroupSchema(org.apache.nifi.minifi.commons.schema.ProcessGroupSchema) Element(org.w3c.dom.Element) ControllerServiceSchema(org.apache.nifi.minifi.commons.schema.ControllerServiceSchema) ConfigurationChangeException(org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeException) FunnelSchema(org.apache.nifi.minifi.commons.schema.FunnelSchema) RemotePortSchema(org.apache.nifi.minifi.commons.schema.RemotePortSchema) PortSchema(org.apache.nifi.minifi.commons.schema.PortSchema) InvalidConfigurationException(org.apache.nifi.minifi.bootstrap.exception.InvalidConfigurationException) ConfigurationChangeException(org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeException) TransformerException(javax.xml.transform.TransformerException) DOMException(org.w3c.dom.DOMException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) ProcessorSchema(org.apache.nifi.minifi.commons.schema.ProcessorSchema) RemoteProcessGroupSchema(org.apache.nifi.minifi.commons.schema.RemoteProcessGroupSchema)

Aggregations

IOException (java.io.IOException)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 TransformerException (javax.xml.transform.TransformerException)1 ConfigurationChangeException (org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeException)1 InvalidConfigurationException (org.apache.nifi.minifi.bootstrap.exception.InvalidConfigurationException)1 ConnectionSchema (org.apache.nifi.minifi.commons.schema.ConnectionSchema)1 ControllerServiceSchema (org.apache.nifi.minifi.commons.schema.ControllerServiceSchema)1 FunnelSchema (org.apache.nifi.minifi.commons.schema.FunnelSchema)1 PortSchema (org.apache.nifi.minifi.commons.schema.PortSchema)1 ProcessGroupSchema (org.apache.nifi.minifi.commons.schema.ProcessGroupSchema)1 ProcessorSchema (org.apache.nifi.minifi.commons.schema.ProcessorSchema)1 RemotePortSchema (org.apache.nifi.minifi.commons.schema.RemotePortSchema)1 RemoteProcessGroupSchema (org.apache.nifi.minifi.commons.schema.RemoteProcessGroupSchema)1 DOMException (org.w3c.dom.DOMException)1 Element (org.w3c.dom.Element)1