use of com.hortonworks.streamline.registries.dashboard.entites.WidgetDatasourceMap in project streamline by hortonworks.
the class DashboardCatalogService method getWidgetDatasourceMapping.
public Set<Long> getWidgetDatasourceMapping(Widget widget) {
List<QueryParam> queryParams = Collections.singletonList(new QueryParam(WidgetDatasourceMap.WIDGET_ID, widget.getId().toString()));
Collection<WidgetDatasourceMap> mappings = dao.find(WIDGET_DATASOURCE_MAPPING_NAMESPACE, queryParams);
if (mappings != null) {
return mappings.stream().map(WidgetDatasourceMap::getWidgetId).collect(Collectors.toSet());
}
return Collections.emptySet();
}
use of com.hortonworks.streamline.registries.dashboard.entites.WidgetDatasourceMap in project streamline by hortonworks.
the class DashboardCatalogService method addWidgetDatasourceMapping.
public void addWidgetDatasourceMapping(Widget widget, Set<Long> datasourceIds) {
datasourceIds.forEach(datasourceId -> {
ensureDatasourceExists(widget.getDashboardId(), datasourceId);
dao.<WidgetDatasourceMap>add(new WidgetDatasourceMap(widget.getId(), datasourceId));
});
}
Aggregations