Search in sources :

Example 1 with Datasource

use of com.hortonworks.streamline.registries.dashboard.entites.Datasource in project streamline by hortonworks.

the class DashboardCatalogService method getDatasource.

public Datasource getDatasource(Long dashboardId, Long datasourceId) {
    Datasource datasource = new Datasource();
    datasource.setDashboardId(dashboardId);
    datasource.setId(datasourceId);
    ensureDashboardExists(dashboardId);
    return dao.get(new StorableKey(DATASOURCE_NAMESPACE, datasource.getPrimaryKey()));
}
Also used : Datasource(com.hortonworks.streamline.registries.dashboard.entites.Datasource) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 2 with Datasource

use of com.hortonworks.streamline.registries.dashboard.entites.Datasource in project streamline by hortonworks.

the class DashboardCatalogService method removeDatasource.

public Datasource removeDatasource(Long dashboardId, Long datasourceId) {
    ensureDashboardExists(dashboardId);
    Datasource datasource = new Datasource();
    datasource.setDashboardId(dashboardId);
    datasource.setId(datasourceId);
    return dao.remove(new StorableKey(DATASOURCE_NAMESPACE, datasource.getPrimaryKey()));
}
Also used : Datasource(com.hortonworks.streamline.registries.dashboard.entites.Datasource) StorableKey(com.hortonworks.registries.storage.StorableKey)

Aggregations

StorableKey (com.hortonworks.registries.storage.StorableKey)2 Datasource (com.hortonworks.streamline.registries.dashboard.entites.Datasource)2