ImageDeliveryImpl.java 1.54 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.cq.dam.dm.delivery.api.ImageDelivery
 *  com.adobe.cq.dam.dm.process.api.PTiffRendition
 *  com.day.cq.dam.api.Asset
 *  org.apache.felix.scr.annotations.Component
 *  org.apache.felix.scr.annotations.Reference
 *  org.apache.felix.scr.annotations.Service
 */
package com.adobe.cq.dam.s7imaging.impl.is;

import com.adobe.cq.dam.dm.delivery.api.ImageDelivery;
import com.adobe.cq.dam.dm.process.api.PTiffRendition;
import com.adobe.cq.dam.dm.process.image.PTiffRenditionFactory;
import com.adobe.cq.dam.s7imaging.impl.is.ImageServerComponent;
import com.day.cq.dam.api.Asset;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;

@Component(immediate=1)
@Service
public class ImageDeliveryImpl
implements ImageDelivery {
    @Reference
    ImageServerComponent imageServer = null;

    public boolean isEnabled() {
        return this.imageServer.isEnabled();
    }

    public PTiffRendition getPTiffRendition(Asset asset) {
        if (asset != null) {
            return PTiffRenditionFactory.getPTiffRendition(asset);
        }
        return null;
    }

    protected void bindImageServer(ImageServerComponent imageServerComponent) {
        this.imageServer = imageServerComponent;
    }

    protected void unbindImageServer(ImageServerComponent imageServerComponent) {
        if (this.imageServer == imageServerComponent) {
            this.imageServer = null;
        }
    }
}