PublishingAgent.java 2.36 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.scene7.is.catalog.CatalogAttributes
 *  com.scene7.is.catalog.CatalogAttributesBean
 *  com.scene7.is.catalog.CatalogRecord
 *  com.scene7.is.catalog.service.publish.atomic.PublishingService
 *  com.scene7.is.catalog.service.publish.atomic.Rendition
 *  com.scene7.is.catalog.util.ObjectTypeEnum
 *  org.jetbrains.annotations.NotNull
 *  scala.Option
 */
package com.adobe.cq.dam.aod.replication;

import com.scene7.is.catalog.CatalogAttributes;
import com.scene7.is.catalog.CatalogAttributesBean;
import com.scene7.is.catalog.CatalogRecord;
import com.scene7.is.catalog.service.publish.atomic.PublishingService;
import com.scene7.is.catalog.service.publish.atomic.Rendition;
import com.scene7.is.catalog.util.ObjectTypeEnum;
import org.jetbrains.annotations.NotNull;
import scala.Option;

public final class PublishingAgent
implements PublishingService {
    @NotNull
    private final String tenantId;
    @NotNull
    private final PublishingService delegate;

    public static PublishingService publishingAgent(@NotNull String tenantId, @NotNull PublishingService delegate) {
        return new PublishingAgent(tenantId, delegate);
    }

    public void test(String rootIdIgnored) {
        this.delegate.test(this.tenantId);
    }

    public void updateAsset(CatalogRecord asset, Option<Rendition> rendition) {
        asset.setRootId(this.tenantId);
        this.delegate.updateAsset(asset, rendition);
    }

    public void deleteAsset(String rootIdIgnored, String assetId, ObjectTypeEnum assetType, long timeStamp) {
        this.delegate.deleteAsset(this.tenantId, assetId, assetType, timeStamp);
    }

    public void updateCatalog(CatalogAttributes catalog) {
        ((CatalogAttributesBean)catalog).setRootId(this.tenantId);
        this.delegate.updateCatalog(catalog);
    }

    public void updateMacro(String rootIdIgnored, String name, String value, long timeStamp) {
        this.delegate.updateMacro(this.tenantId, name, value, timeStamp);
    }

    public void deleteMacro(String rootIdIgnored, String name, long timeStamp) {
        this.delegate.deleteMacro(this.tenantId, name, timeStamp);
    }

    private PublishingAgent(@NotNull String tenantId, @NotNull PublishingService delegate) {
        assert (!tenantId.isEmpty());
        this.tenantId = tenantId;
        this.delegate = delegate;
    }
}