Search in sources :

Example 6 with NifiVisitableProcessor

use of com.thinkbiganalytics.nifi.rest.model.visitor.NifiVisitableProcessor in project kylo by Teradata.

the class NifiConnectionOrderVisitor method visitConnection.

@Override
public void visitConnection(NifiVisitableConnection connection) {
    Set<String> relationships = connection.getDto().getSelectedRelationships();
    String sourceType = connection.getDto().getSource().getType();
    String destType = connection.getDto().getDestination().getType();
    List<NifiVisitableProcessor> destinationProcessors = getDestinationProcessors(connection.getDto(), true);
    List<NifiVisitableProcessor> sourceProcessors = getSourceProcessors(connection.getDto());
    if (destinationProcessors != null) {
        destinationProcessors.forEach(destinationProcessor -> destinationProcessor.addSourceConnectionIdentifier(connection.getDto()));
    }
    if (destinationProcessors != null && sourceProcessors != null) {
        for (NifiVisitableProcessor destination : destinationProcessors) {
            for (NifiVisitableProcessor source : sourceProcessors) {
                destination.addSource(source);
                source.addDestination(destination);
            }
        }
    }
    for (NifiVisitableProcessor sourceProcessor : sourceProcessors) {
        sourceProcessor.addDestinationConnectionIdentifier(connection.getDto());
    }
    allConnections.add(connection);
}
Also used : NifiVisitableProcessor(com.thinkbiganalytics.nifi.rest.model.visitor.NifiVisitableProcessor)

Aggregations

NifiVisitableProcessor (com.thinkbiganalytics.nifi.rest.model.visitor.NifiVisitableProcessor)6 NifiVisitableProcessGroup (com.thinkbiganalytics.nifi.rest.model.visitor.NifiVisitableProcessGroup)4 ProcessorDTO (org.apache.nifi.web.api.dto.ProcessorDTO)4 RemoteProcessGroupDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupDTO)3 NifiComponentNotFoundException (com.thinkbiganalytics.nifi.rest.client.NifiComponentNotFoundException)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 List (java.util.List)2 ConnectableDTO (org.apache.nifi.web.api.dto.ConnectableDTO)2 ConnectionDTO (org.apache.nifi.web.api.dto.ConnectionDTO)2 ProcessGroupDTO (org.apache.nifi.web.api.dto.ProcessGroupDTO)2 ProcessorConfigDTO (org.apache.nifi.web.api.dto.ProcessorConfigDTO)2 NiFiRestClient (com.thinkbiganalytics.nifi.rest.client.NiFiRestClient)1 NifiFlowVisitor (com.thinkbiganalytics.nifi.rest.model.visitor.NifiFlowVisitor)1 NifiVisitableConnection (com.thinkbiganalytics.nifi.rest.model.visitor.NifiVisitableConnection)1 NifiConnectionUtil (com.thinkbiganalytics.nifi.rest.support.NifiConnectionUtil)1 NifiProcessUtil (com.thinkbiganalytics.nifi.rest.support.NifiProcessUtil)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Set (java.util.Set)1