Java Code Examples for org.apache.nifi.web.api.dto.PortDTO#getId()

The following examples show how to use org.apache.nifi.web.api.dto.PortDTO#getId() . 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: FlowController.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
public PortDTO updateInputPort(final String parentGroupId, final PortDTO dto) {
    final ProcessGroup parentGroup = lookupGroup(parentGroupId);
    final Port port = parentGroup.getInputPort(dto.getId());
    if (port == null) {
        throw new IllegalStateException("No Input Port with ID " + dto.getId() + " is known as a child of ProcessGroup with ID " + parentGroupId);
    }

    final String name = dto.getName();
    if (dto.getPosition() != null) {
        port.setPosition(toPosition(dto.getPosition()));
    }

    if (name != null) {
        port.setName(name);
    }

    return createDTO(port);
}
 
Example 2
Source File: FlowController.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
public PortDTO updateOutputPort(final String parentGroupId, final PortDTO dto) {
    final ProcessGroup parentGroup = lookupGroup(parentGroupId);
    final Port port = parentGroup.getOutputPort(dto.getId());
    if (port == null) {
        throw new IllegalStateException("No Output Port with ID " + dto.getId() + " is known as a child of ProcessGroup with ID " + parentGroupId);
    }

    final String name = dto.getName();
    if (name != null) {
        port.setName(name);
    }

    if (dto.getPosition() != null) {
        port.setPosition(toPosition(dto.getPosition()));
    }

    return createDTO(port);
}