Search in sources :

Example 1 with JcrServiceLevelAgreement

use of com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement in project kylo by Teradata.

the class FeedDetails method addServiceLevelAgreement.

public boolean addServiceLevelAgreement(ServiceLevelAgreement sla) {
    JcrServiceLevelAgreement jcrServiceLevelAgreement = (JcrServiceLevelAgreement) sla;
    Node node = jcrServiceLevelAgreement.getNode();
    // add a ref to this node
    return JcrPropertyUtil.addToSetProperty(this.node, SLA, node, true);
}
Also used : JcrServiceLevelAgreement(com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement) Node(javax.jcr.Node)

Example 2 with JcrServiceLevelAgreement

use of com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement in project kylo by Teradata.

the class JcrFeedProvider method enableFeed.

// 
// @Override
// public com.thinkbiganalytics.metadata.api.feed.FeedSource.ID resolveSource(Serializable sid) {
// return new JcrFeedSource.FeedSourceId((sid));
// }
// 
// @Override
// public com.thinkbiganalytics.metadata.api.feed.FeedDestination.ID resolveDestination(Serializable sid) {
// return new JcrFeedDestination.FeedDestinationId(sid);
// }
@Override
public boolean enableFeed(Feed.ID id) {
    Feed feed = getFeed(id);
    if (accessController.isEntityAccessControlled()) {
        feed.getAllowedActions().checkPermission(FeedAccessControl.ENABLE_DISABLE);
    }
    if (!feed.getState().equals(Feed.State.ENABLED)) {
        feed.setState(Feed.State.ENABLED);
        // Enable any SLAs on this feed
        List<ServiceLevelAgreement> serviceLevelAgreements = feed.getServiceLevelAgreements();
        if (serviceLevelAgreements != null) {
            for (ServiceLevelAgreement sla : serviceLevelAgreements) {
                JcrServiceLevelAgreement jcrSla = (JcrServiceLevelAgreement) sla;
                jcrSla.enable();
            }
        }
        return true;
    }
    return false;
}
Also used : JcrServiceLevelAgreement(com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement) ServiceLevelAgreement(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement) JcrServiceLevelAgreement(com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement) Feed(com.thinkbiganalytics.metadata.api.feed.Feed)

Example 3 with JcrServiceLevelAgreement

use of com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement in project kylo by Teradata.

the class JcrFeedProvider method disableFeed.

@Override
public boolean disableFeed(Feed.ID id) {
    Feed feed = getFeed(id);
    if (accessController.isEntityAccessControlled()) {
        feed.getAllowedActions().checkPermission(FeedAccessControl.ENABLE_DISABLE);
    }
    if (!feed.getState().equals(Feed.State.DISABLED)) {
        feed.setState(Feed.State.DISABLED);
        // disable any SLAs on this feed
        List<ServiceLevelAgreement> serviceLevelAgreements = feed.getServiceLevelAgreements();
        if (serviceLevelAgreements != null) {
            for (ServiceLevelAgreement sla : serviceLevelAgreements) {
                JcrServiceLevelAgreement jcrSla = (JcrServiceLevelAgreement) sla;
                jcrSla.disabled();
            }
        }
        return true;
    }
    return false;
}
Also used : JcrServiceLevelAgreement(com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement) ServiceLevelAgreement(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement) JcrServiceLevelAgreement(com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement) Feed(com.thinkbiganalytics.metadata.api.feed.Feed)

Aggregations

JcrServiceLevelAgreement (com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement)3 Feed (com.thinkbiganalytics.metadata.api.feed.Feed)2 ServiceLevelAgreement (com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement)2 Node (javax.jcr.Node)1