RolloutManagerBridge.java 5.95 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.day.cq.wcm.api.Page
 *  com.day.cq.wcm.api.WCMException
 *  com.day.cq.wcm.api.msm.LiveRelationship
 *  com.day.cq.wcm.api.msm.LiveRelationshipManager
 *  com.day.cq.wcm.api.msm.RolloutManager
 *  com.day.cq.wcm.api.msm.RolloutManager$Trigger
 *  com.day.cq.wcm.msm.api.LiveRelationship
 *  com.day.cq.wcm.msm.api.RolloutManager
 *  com.day.cq.wcm.msm.api.RolloutManager$RolloutParams
 *  com.day.cq.wcm.msm.api.RolloutManager$Trigger
 *  javax.jcr.Node
 *  javax.jcr.RepositoryException
 *  org.apache.felix.scr.annotations.Component
 *  org.apache.felix.scr.annotations.Reference
 *  org.apache.felix.scr.annotations.Service
 *  org.apache.sling.api.resource.ResourceResolver
 */
package com.day.cq.wcm.msm.impl.compat;

import com.day.cq.wcm.api.Page;
import com.day.cq.wcm.api.WCMException;
import com.day.cq.wcm.api.msm.LiveRelationshipManager;
import com.day.cq.wcm.api.msm.RolloutManager;
import com.day.cq.wcm.msm.api.LiveRelationship;
import com.day.cq.wcm.msm.api.RolloutManager;
import com.day.cq.wcm.msm.impl.compat.LiveRelationshipManagerBridge;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.ResourceResolver;

@Component
@Service
public class RolloutManagerBridge
implements RolloutManager {
    @Reference
    private com.day.cq.wcm.msm.api.RolloutManager rolloutManager = null;
    @Reference(referenceInterface=LiveRelationshipManager.class, target="(service.pid=com.day.cq.wcm.msm.impl.compat.LiveRelationshipManagerBridge)")
    private LiveRelationshipManagerBridge liveRelationshipMgr;

    protected void bindLiveRelationshipMgr(LiveRelationshipManager relationMgr) {
        this.liveRelationshipMgr = (LiveRelationshipManagerBridge)relationMgr;
    }

    public boolean isReservedProperty(String propertyName) {
        return this.rolloutManager.isReservedProperty(propertyName);
    }

    public boolean isExcludedProperty(String propertyName) {
        return this.rolloutManager.isExcludedProperty(propertyName);
    }

    public void rollout(ResourceResolver resolver, com.day.cq.wcm.api.msm.LiveRelationship relation) throws WCMException {
        this.rollout(resolver, relation, false);
    }

    public void rollout(ResourceResolver resolver, com.day.cq.wcm.api.msm.LiveRelationship relation, boolean reset) throws WCMException {
        LiveRelationship adapted = this.liveRelationshipMgr.adapt(relation, resolver);
        this.rolloutManager.rollout(resolver, adapted, reset);
    }

    public void rollout(Page master, boolean isDeep, RolloutManager.Trigger trigger, String[] targets) throws WCMException {
        this.rollout(master, isDeep, trigger, false, targets);
    }

    public void rollout(Page master, boolean isDeep, RolloutManager.Trigger trigger, boolean reset, String[] targets) throws WCMException {
        RolloutManager.RolloutParams params = new RolloutManager.RolloutParams();
        params.master = master;
        params.isDeep = isDeep;
        params.trigger = RolloutManager.Trigger.fromName((String)trigger.name());
        params.reset = reset;
        params.targets = targets;
        this.rolloutManager.rollout(params);
    }

    public void rollout(Page master, RolloutManager.Trigger trigger, String[] targets, String[] paragraphs) throws WCMException {
        this.rollout(master, trigger, false, targets, paragraphs, false);
    }

    public void rollout(Page master, RolloutManager.Trigger trigger, boolean reset, String[] targets, String[] paragraphs) throws WCMException {
        this.rollout(master, trigger, reset, targets, paragraphs, false);
    }

    public void rollout(Page master, RolloutManager.Trigger trigger, String[] targets, String[] paragraphs, boolean delete) throws WCMException {
        this.rollout(master, trigger, false, targets, paragraphs, delete);
    }

    public void rollout(Page master, RolloutManager.Trigger trigger, boolean reset, String[] targets, String[] paragraphs, boolean delete) throws WCMException {
        RolloutManager.RolloutParams params = new RolloutManager.RolloutParams();
        params.master = master;
        params.trigger = RolloutManager.Trigger.fromName((String)trigger.name());
        params.reset = reset;
        params.targets = targets;
        params.paragraphs = paragraphs;
        params.delete = delete;
        this.rolloutManager.rollout(params);
    }

    public void updateRolloutInfo(Node node, boolean deepUpdate, boolean autoSave) throws WCMException {
        this.rolloutManager.updateRolloutInfo(node, deepUpdate, autoSave);
    }

    public boolean isExcludedProperty(boolean isPage, String propertyName) {
        return this.rolloutManager.isExcludedProperty(isPage, propertyName);
    }

    public boolean isExcludedPageProperty(String propertyName) {
        return this.rolloutManager.isExcludedPageProperty(propertyName);
    }

    public boolean isExcludedParagraphProperty(String propertyName) {
        return this.rolloutManager.isExcludedParagraphProperty(propertyName);
    }

    public boolean isExcludedNodeType(String nodeType) {
        return this.rolloutManager.isExcludedNodeType(nodeType);
    }

    public boolean isExcludedNode(Node node) throws RepositoryException {
        return this.rolloutManager.isExcludedNode(node);
    }

    protected void bindRolloutManager(com.day.cq.wcm.msm.api.RolloutManager rolloutManager) {
        this.rolloutManager = rolloutManager;
    }

    protected void unbindRolloutManager(com.day.cq.wcm.msm.api.RolloutManager rolloutManager) {
        if (this.rolloutManager == rolloutManager) {
            this.rolloutManager = null;
        }
    }

    protected void unbindLiveRelationshipMgr(LiveRelationshipManager liveRelationshipManager) {
        if (this.liveRelationshipMgr == liveRelationshipManager) {
            this.liveRelationshipMgr = null;
        }
    }
}