_ConverterAgentStub.java 9.58 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.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Properties;
import org.omg.CORBA.MARSHAL;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Object;
import org.omg.CORBA.portable.ApplicationException;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.ObjectImpl;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.RemarshalException;

public class _ConverterAgentStub
extends ObjectImpl
implements ConverterAgent {
    private static String[] __ids = new String[]{"IDL:com/adobe/native2pdf/bmc/ConverterAgent:1.0"};

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public ResultStruct convertToPdf(String sourceFilePath, String destFilePath, String appName, int timeoutSeconds, byte[] securityConfig, String distillerJobOptionsName, byte[] appSpecificConfig, AppMonData appMonConfig, boolean applyWatermark, boolean createPDFAOCR, String jobIdentityId, int startPage, int endPage, String ocrlanguageChosen) {
        InputStream $in = null;
        try {
            ResultStruct $result;
            OutputStream $out = this._request("convertToPdf", true);
            $out.write_wstring(sourceFilePath);
            $out.write_wstring(destFilePath);
            $out.write_wstring(appName);
            $out.write_long(timeoutSeconds);
            ByteArrayHelper.write($out, securityConfig);
            $out.write_wstring(distillerJobOptionsName);
            ByteArrayHelper.write($out, appSpecificConfig);
            AppMonDataHelper.write($out, appMonConfig);
            $out.write_boolean(applyWatermark);
            $out.write_boolean(createPDFAOCR);
            $out.write_wstring(jobIdentityId);
            $out.write_long(startPage);
            $out.write_long(endPage);
            $out.write_wstring(ocrlanguageChosen);
            $in = this._invoke($out);
            ResultStruct resultStruct = $result = ResultStructHelper.read($in);
            return resultStruct;
        }
        catch (ApplicationException $ex) {
            $in = $ex.getInputStream();
            String _id = $ex.getId();
            throw new MARSHAL(_id);
        }
        catch (RemarshalException $rm) {
            ResultStruct _id = this.convertToPdf(sourceFilePath, destFilePath, appName, timeoutSeconds, securityConfig, distillerJobOptionsName, appSpecificConfig, appMonConfig, applyWatermark, createPDFAOCR, jobIdentityId, startPage, endPage, ocrlanguageChosen);
            return _id;
        }
        finally {
            this._releaseReply($in);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public ResultStruct convertToPdfUsingOpenOffice(String sourceFilePath, String destFilePath, byte[] openOfficeData, int timeoutSeconds, String jobIdentityId) {
        InputStream $in = null;
        try {
            ResultStruct $result;
            OutputStream $out = this._request("convertToPdfUsingOpenOffice", true);
            $out.write_wstring(sourceFilePath);
            $out.write_wstring(destFilePath);
            ByteArrayHelper.write($out, openOfficeData);
            $out.write_long(timeoutSeconds);
            $out.write_wstring(jobIdentityId);
            $in = this._invoke($out);
            ResultStruct resultStruct = $result = ResultStructHelper.read($in);
            return resultStruct;
        }
        catch (ApplicationException $ex) {
            $in = $ex.getInputStream();
            String _id = $ex.getId();
            throw new MARSHAL(_id);
        }
        catch (RemarshalException $rm) {
            ResultStruct _id = this.convertToPdfUsingOpenOffice(sourceFilePath, destFilePath, openOfficeData, timeoutSeconds, jobIdentityId);
            return _id;
        }
        finally {
            this._releaseReply($in);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public ResultStruct convertHtmlToPdf(String url, String destFilePath, int timeoutSeconds, byte[] appSpecificConfig, int spideringLevel, String jobIdentityId) {
        InputStream $in = null;
        try {
            ResultStruct $result;
            OutputStream $out = this._request("convertHtmlToPdf", true);
            $out.write_wstring(url);
            $out.write_wstring(destFilePath);
            $out.write_long(timeoutSeconds);
            ByteArrayHelper.write($out, appSpecificConfig);
            $out.write_long(spideringLevel);
            $out.write_wstring(jobIdentityId);
            $in = this._invoke($out);
            ResultStruct resultStruct = $result = ResultStructHelper.read($in);
            return resultStruct;
        }
        catch (ApplicationException $ex) {
            $in = $ex.getInputStream();
            String _id = $ex.getId();
            throw new MARSHAL(_id);
        }
        catch (RemarshalException $rm) {
            ResultStruct _id = this.convertHtmlToPdf(url, destFilePath, timeoutSeconds, appSpecificConfig, spideringLevel, jobIdentityId);
            return _id;
        }
        finally {
            this._releaseReply($in);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public ResultStruct convertImgToPdf(String sourceFilePath, String destFilePath, int timeoutSeconds, double pdfVersion, String jobIdentityId) {
        InputStream $in = null;
        try {
            ResultStruct $result;
            OutputStream $out = this._request("convertImgToPdf", true);
            $out.write_wstring(sourceFilePath);
            $out.write_wstring(destFilePath);
            $out.write_long(timeoutSeconds);
            $out.write_double(pdfVersion);
            $out.write_wstring(jobIdentityId);
            $in = this._invoke($out);
            ResultStruct resultStruct = $result = ResultStructHelper.read($in);
            return resultStruct;
        }
        catch (ApplicationException $ex) {
            $in = $ex.getInputStream();
            String _id = $ex.getId();
            throw new MARSHAL(_id);
        }
        catch (RemarshalException $rm) {
            ResultStruct _id = this.convertImgToPdf(sourceFilePath, destFilePath, timeoutSeconds, pdfVersion, jobIdentityId);
            return _id;
        }
        finally {
            this._releaseReply($in);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public boolean cleanUp() {
        InputStream $in = null;
        try {
            boolean $result;
            OutputStream $out = this._request("cleanUp", true);
            $in = this._invoke($out);
            boolean bl = $result = $in.read_boolean();
            return bl;
        }
        catch (ApplicationException $ex) {
            $in = $ex.getInputStream();
            String _id = $ex.getId();
            throw new MARSHAL(_id);
        }
        catch (RemarshalException $rm) {
            boolean _id = this.cleanUp();
            return _id;
        }
        finally {
            this._releaseReply($in);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public ResultStruct convertSwfToPdf(String sourceFilePath, String destFilePath, int dpi, int timeoutSeconds, String jobIdentityId) {
        InputStream $in = null;
        try {
            ResultStruct $result;
            OutputStream $out = this._request("convertSwfToPdf", true);
            $out.write_wstring(sourceFilePath);
            $out.write_wstring(destFilePath);
            $out.write_long(dpi);
            $out.write_long(timeoutSeconds);
            $out.write_wstring(jobIdentityId);
            $in = this._invoke($out);
            ResultStruct resultStruct = $result = ResultStructHelper.read($in);
            return resultStruct;
        }
        catch (ApplicationException $ex) {
            $in = $ex.getInputStream();
            String _id = $ex.getId();
            throw new MARSHAL(_id);
        }
        catch (RemarshalException $rm) {
            ResultStruct _id = this.convertSwfToPdf(sourceFilePath, destFilePath, dpi, timeoutSeconds, jobIdentityId);
            return _id;
        }
        finally {
            this._releaseReply($in);
        }
    }

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

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void readObject(ObjectInputStream s) throws IOException {
        String str = s.readUTF();
        String[] args = null;
        Properties props = null;
        ORB orb = ORB.init(args, props);
        try {
            Object obj = orb.string_to_object(str);
            Delegate delegate = ((ObjectImpl)obj)._get_delegate();
            this._set_delegate(delegate);
        }
        finally {
            orb.destroy();
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void writeObject(ObjectOutputStream s) throws IOException {
        String[] args = null;
        Properties props = null;
        ORB orb = ORB.init(args, props);
        try {
            String str = orb.object_to_string(this);
            s.writeUTF(str);
        }
        finally {
            orb.destroy();
        }
    }
}