use of com.thinkbiganalytics.nifi.rest.client.layout.ProcessGroupAndConnections in project kylo by Teradata.
the class CleanupStaleFeedRevisions method doCleanup.
private void doCleanup(String processGroupId) {
stoppedPorts.clear();
AlignProcessGroupComponents alignProcessGroupComponents = new AlignProcessGroupComponents(restClient.getNiFiRestClient(), processGroupId);
alignProcessGroupComponents.groupItems();
final Map<String, ProcessGroupAndConnections> groups = alignProcessGroupComponents.getProcessGroupWithConnectionsMap();
Set<ProcessGroupAndConnections> deletedItems = new HashSet<>();
groups.values().stream().filter(groupAndConnections -> NifiTemplateNameUtil.isVersionedProcessGroup(groupAndConnections.getProcessGroup().getName())).filter(groupAndConnections -> canDelete(groupAndConnections.getProcessGroup())).forEach(groupAndConnections -> {
cleanup(groupAndConnections);
deletedItems.add(groupAndConnections);
});
startPorts();
// relayout the group
if (!deletedItems.isEmpty()) {
new AlignProcessGroupComponents(restClient.getNiFiRestClient(), processGroupId).autoLayout();
}
}
Aggregations