_ConverterAgentImplBase.java 5.75 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.native2pdf.bmc;

import com.adobe.native2pdf.bmc.AppMonData;
import com.adobe.native2pdf.bmc.AppMonDataHelper;
import com.adobe.native2pdf.bmc.ByteArrayHelper;
import com.adobe.native2pdf.bmc.ConverterAgent;
import com.adobe.native2pdf.bmc.ResultStruct;
import com.adobe.native2pdf.bmc.ResultStructHelper;
import java.util.Hashtable;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.CompletionStatus;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.ObjectImpl;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;

public abstract class _ConverterAgentImplBase
extends ObjectImpl
implements ConverterAgent,
InvokeHandler {
    private static Hashtable _methods = new Hashtable();
    private static String[] __ids;

    public OutputStream _invoke(String $method, InputStream in, ResponseHandler $rh) {
        OutputStream out = null;
        Integer __method = (Integer)_methods.get($method);
        if (__method == null) {
            throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
        }
        switch (__method) {
            case 0: {
                String sourceFilePath = in.read_wstring();
                String destFilePath = in.read_wstring();
                String appName = in.read_wstring();
                int timeoutSeconds = in.read_long();
                byte[] securityConfig = ByteArrayHelper.read(in);
                String distillerJobOptionsName = in.read_wstring();
                byte[] appSpecificConfig = ByteArrayHelper.read(in);
                AppMonData appMonConfig = AppMonDataHelper.read(in);
                boolean applyWatermark = in.read_boolean();
                boolean createPDFAOCR = in.read_boolean();
                String jobIdentityId = in.read_wstring();
                int startPage = in.read_long();
                int endPage = in.read_long();
                String ocrlanguageChosen = in.read_wstring();
                ResultStruct $result = null;
                $result = this.convertToPdf(sourceFilePath, destFilePath, appName, timeoutSeconds, securityConfig, distillerJobOptionsName, appSpecificConfig, appMonConfig, applyWatermark, createPDFAOCR, jobIdentityId, startPage, endPage, ocrlanguageChosen);
                out = $rh.createReply();
                ResultStructHelper.write(out, $result);
                break;
            }
            case 1: {
                String sourceFilePath = in.read_wstring();
                String destFilePath = in.read_wstring();
                byte[] openOfficeData = ByteArrayHelper.read(in);
                int timeoutSeconds = in.read_long();
                String jobIdentityId = in.read_wstring();
                ResultStruct $result = null;
                $result = this.convertToPdfUsingOpenOffice(sourceFilePath, destFilePath, openOfficeData, timeoutSeconds, jobIdentityId);
                out = $rh.createReply();
                ResultStructHelper.write(out, $result);
                break;
            }
            case 2: {
                String url = in.read_wstring();
                String destFilePath = in.read_wstring();
                int timeoutSeconds = in.read_long();
                byte[] appSpecificConfig = ByteArrayHelper.read(in);
                int spideringLevel = in.read_long();
                String jobIdentityId = in.read_wstring();
                ResultStruct $result = null;
                $result = this.convertHtmlToPdf(url, destFilePath, timeoutSeconds, appSpecificConfig, spideringLevel, jobIdentityId);
                out = $rh.createReply();
                ResultStructHelper.write(out, $result);
                break;
            }
            case 3: {
                String sourceFilePath = in.read_wstring();
                String destFilePath = in.read_wstring();
                int timeoutSeconds = in.read_long();
                double pdfVersion = in.read_double();
                String jobIdentityId = in.read_wstring();
                ResultStruct $result = null;
                $result = this.convertImgToPdf(sourceFilePath, destFilePath, timeoutSeconds, pdfVersion, jobIdentityId);
                out = $rh.createReply();
                ResultStructHelper.write(out, $result);
                break;
            }
            case 4: {
                boolean $result = false;
                $result = this.cleanUp();
                out = $rh.createReply();
                out.write_boolean($result);
                break;
            }
            case 5: {
                String sourceFilePath = in.read_wstring();
                String destFilePath = in.read_wstring();
                int dpi = in.read_long();
                int timeoutSeconds = in.read_long();
                String jobIdentityId = in.read_wstring();
                ResultStruct $result = null;
                $result = this.convertSwfToPdf(sourceFilePath, destFilePath, dpi, timeoutSeconds, jobIdentityId);
                out = $rh.createReply();
                ResultStructHelper.write(out, $result);
                break;
            }
            default: {
                throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
            }
        }
        return out;
    }

    public String[] _ids() {
        return (String[])__ids.clone();
    }

    static {
        _methods.put("convertToPdf", new Integer(0));
        _methods.put("convertToPdfUsingOpenOffice", new Integer(1));
        _methods.put("convertHtmlToPdf", new Integer(2));
        _methods.put("convertImgToPdf", new Integer(3));
        _methods.put("cleanUp", new Integer(4));
        _methods.put("convertSwfToPdf", new Integer(5));
        __ids = new String[]{"IDL:com/adobe/native2pdf/bmc/ConverterAgent:1.0"};
    }
}