Search in sources :

Example 6 with RemoteProcessGroupPortDescriptor

use of org.apache.nifi.groups.RemoteProcessGroupPortDescriptor in project nifi by apache.

the class FlowController method convertRemotePort.

/**
 * Converts a set of ports into a set of remote process group ports.
 *
 * @param ports ports
 * @return group descriptors
 */
private Set<RemoteProcessGroupPortDescriptor> convertRemotePort(final Set<RemoteProcessGroupPortDTO> ports) {
    Set<RemoteProcessGroupPortDescriptor> remotePorts = null;
    if (ports != null) {
        remotePorts = new LinkedHashSet<>(ports.size());
        for (final RemoteProcessGroupPortDTO port : ports) {
            final StandardRemoteProcessGroupPortDescriptor descriptor = new StandardRemoteProcessGroupPortDescriptor();
            descriptor.setId(port.getId());
            descriptor.setVersionedComponentId(port.getVersionedComponentId());
            descriptor.setTargetId(port.getTargetId());
            descriptor.setName(port.getName());
            descriptor.setComments(port.getComments());
            descriptor.setTargetRunning(port.isTargetRunning());
            descriptor.setConnected(port.isConnected());
            descriptor.setConcurrentlySchedulableTaskCount(port.getConcurrentlySchedulableTaskCount());
            descriptor.setTransmitting(port.isTransmitting());
            descriptor.setUseCompression(port.getUseCompression());
            final BatchSettingsDTO batchSettings = port.getBatchSettings();
            if (batchSettings != null) {
                descriptor.setBatchCount(batchSettings.getCount());
                descriptor.setBatchSize(batchSettings.getSize());
                descriptor.setBatchDuration(batchSettings.getDuration());
            }
            remotePorts.add(descriptor);
        }
    }
    return remotePorts;
}
Also used : BatchSettingsDTO(org.apache.nifi.web.api.dto.BatchSettingsDTO) StandardRemoteProcessGroupPortDescriptor(org.apache.nifi.remote.StandardRemoteProcessGroupPortDescriptor) RemoteProcessGroupPortDescriptor(org.apache.nifi.groups.RemoteProcessGroupPortDescriptor) StandardRemoteProcessGroupPortDescriptor(org.apache.nifi.remote.StandardRemoteProcessGroupPortDescriptor) RemoteProcessGroupPortDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO)

Aggregations

RemoteProcessGroupPortDescriptor (org.apache.nifi.groups.RemoteProcessGroupPortDescriptor)6 ArrayList (java.util.ArrayList)4 PortDTO (org.apache.nifi.web.api.dto.PortDTO)3 HashSet (java.util.HashSet)2 Connection (org.apache.nifi.connectable.Connection)2 Port (org.apache.nifi.connectable.Port)2 Position (org.apache.nifi.connectable.Position)2 Size (org.apache.nifi.connectable.Size)2 ProcessorInstantiationException (org.apache.nifi.controller.exception.ProcessorInstantiationException)2 Label (org.apache.nifi.controller.label.Label)2 ReportingTaskInstantiationException (org.apache.nifi.controller.reporting.ReportingTaskInstantiationException)2 ControllerServiceNode (org.apache.nifi.controller.service.ControllerServiceNode)2 FlowFilePrioritizer (org.apache.nifi.flowfile.FlowFilePrioritizer)2 ProcessGroup (org.apache.nifi.groups.ProcessGroup)2 RemoteProcessGroup (org.apache.nifi.groups.RemoteProcessGroup)2 RemoteGroupPort (org.apache.nifi.remote.RemoteGroupPort)2 RootGroupPort (org.apache.nifi.remote.RootGroupPort)2 ConnectionDTO (org.apache.nifi.web.api.dto.ConnectionDTO)2 LabelDTO (org.apache.nifi.web.api.dto.LabelDTO)2 PositionDTO (org.apache.nifi.web.api.dto.PositionDTO)2