use of org.apache.nifi.minifi.commons.schema.PortSchema 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);
}
}
use of org.apache.nifi.minifi.commons.schema.PortSchema in project nifi-minifi by apache.
the class PortSchemaFunctionTest method testNoId.
@Test
public void testNoId() {
portDTO.setId(null);
PortSchema portSchema = portSchemaFunction.apply(portDTO);
assertEquals("", portSchema.getId());
assertEquals(testName, portSchema.getName());
assertFalse(portSchema.isValid());
}
use of org.apache.nifi.minifi.commons.schema.PortSchema in project nifi-minifi by apache.
the class PortSchemaFunctionTest method testNoName.
@Test
public void testNoName() {
portDTO.setName(null);
PortSchema portSchema = portSchemaFunction.apply(portDTO);
assertEquals(testId, portSchema.getId());
assertEquals("", portSchema.getName());
assertTrue(portSchema.isValid());
}
use of org.apache.nifi.minifi.commons.schema.PortSchema in project nifi-minifi by apache.
the class PortSchemaFunctionTest method testFullMap.
@Test
public void testFullMap() {
PortSchema portSchema = portSchemaFunction.apply(portDTO);
assertEquals(testId, portSchema.getId());
assertEquals(testName, portSchema.getName());
assertTrue(portSchema.isValid());
}
Aggregations