Search in sources :

Example 1 with JpaServiceLevelAgreementDescription

use of com.thinkbiganalytics.metadata.jpa.sla.JpaServiceLevelAgreementDescription in project kylo by Teradata.

the class OpsFeedManagerFeedProvider method delete.

@Override
public void delete(OpsManagerFeed.ID id) {
    OpsManagerFeed feed = repository.findByIdWithoutAcl(id);
    if (feed != null) {
        log.info("Deleting feed {} ({})  and all job executions. ", feed.getName(), feed.getId());
        // first delete all jobs for this feed
        deleteFeedJobs(FeedNameUtil.category(feed.getName()), FeedNameUtil.feed(feed.getName()));
        // remove an slas on this feed
        List<JpaServiceLevelAgreementDescription> slas = serviceLevelAgreementDescriptionRepository.findForFeed(id);
        if (slas != null && !slas.isEmpty()) {
            serviceLevelAgreementDescriptionRepository.delete(slas);
        }
        feedStatisticsProvider.deleteFeedStats(feed.getName());
        delete(feed);
        log.info("Successfully deleted the feed {} ({})  and all job executions. ", feed.getName(), feed.getId());
    }
}
Also used : OpsManagerFeed(com.thinkbiganalytics.metadata.api.feed.OpsManagerFeed) JpaServiceLevelAgreementDescription(com.thinkbiganalytics.metadata.jpa.sla.JpaServiceLevelAgreementDescription)

Aggregations

OpsManagerFeed (com.thinkbiganalytics.metadata.api.feed.OpsManagerFeed)1 JpaServiceLevelAgreementDescription (com.thinkbiganalytics.metadata.jpa.sla.JpaServiceLevelAgreementDescription)1