use of com.thinkbiganalytics.kylo.catalog.rest.model.ConnectorPluginDescriptor in project kylo by Teradata.
the class DataSourceProvider method findMatchingControllerService.
private List<ControllerServiceDTO> findMatchingControllerService(@Nonnull final DataSource dataSource, @Nonnull final Map<String, String> properties, @Nonnull final ConnectorPluginDescriptor connectorPluginDescriptor) {
ConnectorPluginNiFiControllerService plugin = connectorPluginDescriptor.getNifiControllerService();
String type = plugin.getType();
Map<String, String> identityProperties = plugin.getIdentityProperties().stream().collect(Collectors.toMap(propertyKey -> propertyKey, propertyKey -> properties.get(propertyKey)));
// TODO hit cache first
String rootProcessGroupId = nifiRestClient.processGroups().findRoot().getId();
return nifiRestClient.processGroups().getControllerServices(rootProcessGroupId).stream().filter(controllerServiceDTO -> isMatch(controllerServiceDTO, type, dataSource.getTitle(), identityProperties)).collect(Collectors.toList());
}
Aggregations