use of com.thinkbiganalytics.nifi.rest.model.flow.NifiFlowConnection in project kylo by Teradata.
the class NifiFlowCacheImpl method updateConnectionMap.
private void updateConnectionMap(Collection<ConnectionDTO> connections, boolean notifyClusterMembers) {
Map<String, NifiFlowConnection> connectionIdToConnectionMap = new HashMap<>();
if (connections != null) {
connections.stream().forEach(connectionDTO -> {
NifiFlowConnection nifiFlowConnection = NiFiFlowConnectionConverter.toNiFiFlowConnection(connectionDTO);
if (nifiFlowConnection != null) {
connectionIdToConnectionMap.put(nifiFlowConnection.getConnectionIdentifier(), nifiFlowConnection);
}
});
}
this.connectionIdToConnectionMap.putAll(toConnectionIdMap(connectionIdToConnectionMap.values()));
if (connections != null) {
Map<String, String> connectionIdToNameMap = connections.stream().collect(Collectors.toMap(conn -> conn.getId(), conn -> conn.getName()));
connectionIdCacheNameMap.putAll(connectionIdToNameMap);
}
if (notifyClusterMembers) {
if (nifiFlowCacheClusterManager.isClustered()) {
nifiFlowCacheClusterManager.updateConnections(connections);
}
lastUpdated = DateTime.now();
}
}
Aggregations