Java Code Examples for org.apache.nifi.web.api.dto.ConnectableDTO#setName()

The following examples show how to use org.apache.nifi.web.api.dto.ConnectableDTO#setName() . 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: TemplateUtils.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
/**
 * Remove unnecessary fields in connectables prior to saving.
 *
 * @param connectable connectable
 */
private static void scrubConnectable(final ConnectableDTO connectable) {
    if (connectable != null) {
        connectable.setComments(null);
        connectable.setExists(null);
        connectable.setRunning(null);
        connectable.setTransmitting(null);
        connectable.setName(null);
    }
}
 
Example 2
Source File: FlowSnippetDTOEnricher.java    From nifi-minifi with Apache License 2.0 5 votes vote down vote up
private static void setName(Map<String, String> connectableNameMap, ConnectableDTO connectableDTO, Map<String, String> nameOverrides) {
    if (connectableDTO != null) {
        final String name = connectableNameMap.get(connectableDTO.getId());
        if (name != null) {
            connectableDTO.setName(Optional.ofNullable(nameOverrides.get(connectableDTO.getId())).orElse(name));
        }
    }
}
 
Example 3
Source File: TemplateUtils.java    From nifi with Apache License 2.0 5 votes vote down vote up
/**
 * Remove unnecessary fields in connectables prior to saving.
 *
 * @param connectable connectable
 */
private static void scrubConnectable(final ConnectableDTO connectable) {
    if (connectable != null) {
        connectable.setComments(null);
        connectable.setExists(null);
        connectable.setRunning(null);
        connectable.setTransmitting(null);
        connectable.setName(null);
    }
}
 
Example 4
Source File: NiFiClientUtil.java    From nifi with Apache License 2.0 5 votes vote down vote up
public ConnectableDTO createConnectableDTO(final ProcessorEntity processor) {
    final ConnectableDTO dto = new ConnectableDTO();
    dto.setGroupId(processor.getComponent().getParentGroupId());
    dto.setId(processor.getId());
    dto.setName(processor.getComponent().getName());
    dto.setRunning("RUNNING".equalsIgnoreCase(processor.getComponent().getState()));
    dto.setType("PROCESSOR");

    return dto;
}
 
Example 5
Source File: NiFiClientUtil.java    From nifi with Apache License 2.0 5 votes vote down vote up
public ConnectableDTO createConnectableDTO(final PortEntity port) {
    final ConnectableDTO dto = new ConnectableDTO();
    dto.setGroupId(port.getComponent().getParentGroupId());
    dto.setId(port.getId());
    dto.setName(port.getComponent().getName());
    dto.setRunning("RUNNING".equalsIgnoreCase(port.getComponent().getState()));
    dto.setType(port.getPortType());

    return dto;
}