Search in sources :

Example 6 with JcrDatasource

use of com.thinkbiganalytics.metadata.modeshape.datasource.JcrDatasource in project kylo by Teradata.

the class JcrFeedProvider method ensureFeedSource.

@Override
public FeedSource ensureFeedSource(Feed.ID feedId, Datasource.ID dsId) {
    JcrFeed feed = (JcrFeed) findById(feedId);
    FeedSource source = feed.getSource(dsId);
    if (source == null) {
        JcrDatasource datasource = (JcrDatasource) datasourceProvider.getDatasource(dsId);
        if (datasource != null) {
            JcrFeedSource jcrSrc = feed.ensureFeedSource(datasource);
            // save();
            return jcrSrc;
        } else {
            throw new DatasourceNotFoundException(dsId);
        }
    } else {
        return source;
    }
}
Also used : JcrDatasource(com.thinkbiganalytics.metadata.modeshape.datasource.JcrDatasource) FeedSource(com.thinkbiganalytics.metadata.api.feed.FeedSource) DatasourceNotFoundException(com.thinkbiganalytics.metadata.api.datasource.DatasourceNotFoundException)

Aggregations

JcrDatasource (com.thinkbiganalytics.metadata.modeshape.datasource.JcrDatasource)6 FeedSource (com.thinkbiganalytics.metadata.api.feed.FeedSource)3 Node (javax.jcr.Node)3 RepositoryException (javax.jcr.RepositoryException)3 DatasourceNotFoundException (com.thinkbiganalytics.metadata.api.datasource.DatasourceNotFoundException)2 MetadataRepositoryException (com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException)2 JcrDerivedDatasource (com.thinkbiganalytics.metadata.modeshape.datasource.JcrDerivedDatasource)2 JcrFeed (com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed)2 KyloVersion (com.thinkbiganalytics.KyloVersion)1 NifiControllerServiceProperties (com.thinkbiganalytics.feedmgr.nifi.NifiControllerServiceProperties)1 ConnectorPluginManager (com.thinkbiganalytics.kylo.catalog.ConnectorPluginManager)1 Connector (com.thinkbiganalytics.metadata.api.catalog.Connector)1 ConnectorProvider (com.thinkbiganalytics.metadata.api.catalog.ConnectorProvider)1 DataSetSparkParameters (com.thinkbiganalytics.metadata.api.catalog.DataSetSparkParameters)1 Category (com.thinkbiganalytics.metadata.api.category.Category)1 DatasourceProvider (com.thinkbiganalytics.metadata.api.datasource.DatasourceProvider)1 FeedDestination (com.thinkbiganalytics.metadata.api.feed.FeedDestination)1 FeedProvider (com.thinkbiganalytics.metadata.api.feed.FeedProvider)1 JcrMetadataAccess (com.thinkbiganalytics.metadata.modeshape.JcrMetadataAccess)1 JcrDataSetSparkParameters (com.thinkbiganalytics.metadata.modeshape.catalog.JcrDataSetSparkParameters)1