private Set<VersionedConnection> findAllConnections(final VersionedProcessGroup group) { final Set<VersionedConnection> conns = new HashSet<>(); for (final VersionedConnection connection : group.getConnections()) { conns.add(connection); } for (final VersionedProcessGroup childGroup : group.getProcessGroups()) { conns.addAll(findAllConnections(childGroup)); } return conns; }
private void findAllConnections(final VersionedProcessGroup group, final Map<String, VersionedConnection> map) { for (final VersionedConnection connection : group.getConnections()) { map.put(connection.getIdentifier(), connection); } for (final VersionedProcessGroup childGroup : group.getProcessGroups()) { findAllConnections(childGroup, map); } }
private void findAllConnectionIds(final VersionedProcessGroup group, final Set<String> ids) { for (final VersionedConnection connection : group.getConnections()) { ids.add(connection.getIdentifier()); } for (final VersionedProcessGroup childGroup : group.getProcessGroups()) { findAllConnectionIds(childGroup, ids); } }
allConns.addAll(versionedFlow.getConnections()); for (final VersionedProcessGroup childGroup : versionedFlow.getProcessGroups()) { allConns.addAll(findAllConnections(childGroup));
final Set<String> connectionsRemoved = new HashSet<>(connectionsByVersionedId.keySet()); for (final VersionedConnection proposedConnection : proposed.getConnections()) { final Connection connection = connectionsByVersionedId.get(proposedConnection.getIdentifier()); if (connection == null) {
copy.setPosition(processGroup.getPosition()); copy.setVersionedFlowCoordinates(topLevel ? null : processGroup.getVersionedFlowCoordinates()); copy.setConnections(processGroup.getConnections()); copy.setControllerServices(processGroup.getControllerServices()); copy.setFunnels(processGroup.getFunnels());
group.setConnections(contents.getConnections()); group.setControllerServices(contents.getControllerServices()); group.setFunnels(contents.getFunnels());
.collect(Collectors.toList())); map.put(CommonPropertyKeys.CONNECTIONS_KEY, nullToEmpty(versionedProcessGroup.getConnections()).stream() .map(connectionSchemaFunction) .sorted(Comparator.comparing(ConnectionSchema::getName))
.collect(Collectors.toList())); map.put(CommonPropertyKeys.CONNECTIONS_KEY, nullToEmpty(versionedProcessGroup.getConnections()).stream() .map(connectionSchemaFunction) .sorted(Comparator.comparing(ConnectionSchema::getName))
private void compare(final VersionedProcessGroup groupA, final VersionedProcessGroup groupB, final Set<FlowDifference> differences, final boolean compareNamePos) { if (compareComponents(groupA, groupB, differences, compareNamePos, compareNamePos, true)) { return; } if (groupA == null) { differences.add(difference(DifferenceType.COMPONENT_ADDED, groupA, groupB, groupA, groupB)); return; } if (groupB == null) { differences.add(difference(DifferenceType.COMPONENT_REMOVED, groupA, groupB, groupA, groupB)); return; } addIfDifferent(differences, DifferenceType.VERSIONED_FLOW_COORDINATES_CHANGED, groupA, groupB, VersionedProcessGroup::getVersionedFlowCoordinates); if (groupA.getVersionedFlowCoordinates() == null && groupB.getVersionedFlowCoordinates() == null) { differences.addAll(compareComponents(groupA.getConnections(), groupB.getConnections(), this::compare)); differences.addAll(compareComponents(groupA.getProcessors(), groupB.getProcessors(), this::compare)); differences.addAll(compareComponents(groupA.getControllerServices(), groupB.getControllerServices(), this::compare)); differences.addAll(compareComponents(groupA.getFunnels(), groupB.getFunnels(), this::compare)); differences.addAll(compareComponents(groupA.getInputPorts(), groupB.getInputPorts(), this::compare)); differences.addAll(compareComponents(groupA.getLabels(), groupB.getLabels(), this::compare)); differences.addAll(compareComponents(groupA.getOutputPorts(), groupB.getOutputPorts(), this::compare)); differences.addAll(compareComponents(groupA.getProcessGroups(), groupB.getProcessGroups(), (a, b, diffs) -> compare(a, b, diffs, true))); differences.addAll(compareComponents(groupA.getRemoteProcessGroups(), groupB.getRemoteProcessGroups(), this::compare)); } }