Java Code Examples for org.apache.nifi.groups.ProcessGroup#getOutputPorts()

The following examples show how to use org.apache.nifi.groups.ProcessGroup#getOutputPorts() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ControllerFacade.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the output ports on the root group.
 *
 * @return output ports
 */
public Set<RootGroupPort> getOutputPorts() {
    final Set<RootGroupPort> outputPorts = new HashSet<>();
    ProcessGroup rootGroup = flowController.getGroup(flowController.getRootGroupId());
    for (final Port port : rootGroup.getOutputPorts()) {
        if (port instanceof RootGroupPort) {
            outputPorts.add((RootGroupPort) port);
        }
    }
    return outputPorts;
}
 
Example 2
Source File: DtoFactory.java    From localization_nifi with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a ProcessGroupContentDTO from the specified ProcessGroup.
 *
 * @param group group
 * @param recurse recurse
 * @return dto
 */
private FlowSnippetDTO createProcessGroupContentsDto(final ProcessGroup group, final boolean recurse) {
    if (group == null) {
        return null;
    }

    final FlowSnippetDTO dto = new FlowSnippetDTO();

    for (final ProcessorNode procNode : group.getProcessors()) {
        dto.getProcessors().add(createProcessorDto(procNode));
    }

    for (final Connection connNode : group.getConnections()) {
        dto.getConnections().add(createConnectionDto(connNode));
    }

    for (final Label label : group.getLabels()) {
        dto.getLabels().add(createLabelDto(label));
    }

    for (final Funnel funnel : group.getFunnels()) {
        dto.getFunnels().add(createFunnelDto(funnel));
    }

    for (final ProcessGroup childGroup : group.getProcessGroups()) {
        if (recurse) {
            dto.getProcessGroups().add(createProcessGroupDto(childGroup, recurse));
        } else {
            dto.getProcessGroups().add(createConciseProcessGroupDto(childGroup));
        }
    }

    for (final RemoteProcessGroup remoteProcessGroup : group.getRemoteProcessGroups()) {
        dto.getRemoteProcessGroups().add(createRemoteProcessGroupDto(remoteProcessGroup));
    }

    for (final Port inputPort : group.getInputPorts()) {
        dto.getInputPorts().add(createPortDto(inputPort));
    }

    for (final Port outputPort : group.getOutputPorts()) {
        dto.getOutputPorts().add(createPortDto(outputPort));
    }

    return dto;
}
 
Example 3
Source File: StandardOutputPortDAO.java    From localization_nifi with Apache License 2.0 4 votes vote down vote up
@Override
public Set<Port> getPorts(String groupId) {
    ProcessGroup group = locateProcessGroup(flowController, groupId);
    return group.getOutputPorts();
}
 
Example 4
Source File: StandardOutputPortDAO.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public Set<Port> getPorts(String groupId) {
    ProcessGroup group = locateProcessGroup(flowController, groupId);
    return group.getOutputPorts();
}