PsToPdfServicePOA.java 3.26 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.ps2pdf;

import com.adobe.ps2pdf.*;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.Servant;

import java.util.Hashtable;

public abstract class PsToPdfServicePOA
extends Servant
implements InvokeHandler,
PsToPdfServiceOperations {
    private static final Hashtable m_opsHash = new Hashtable();
    private String[] ids = new String[]{"IDL:com/adobe/ps2pdf/PsToPdfService:1.0"};

    public PsToPdfService _this() {
        return PsToPdfServiceHelper.narrow(this._this_object());
    }

    public PsToPdfService _this(ORB orb) {
        return PsToPdfServiceHelper.narrow(this._this_object(orb));
    }

    public OutputStream _invoke(String method, InputStream _input, ResponseHandler handler) throws SystemException {
        OutputStream _out = null;
        Integer opsIndex = (Integer)m_opsHash.get(method);
        if (null == opsIndex) {
            throw new BAD_OPERATION(method + " not found");
        }
        switch (opsIndex) {
            case 0: {
                try {
                    PsToPdfFilePaths _arg0 = PsToPdfFilePathsHelper.read(_input);
                    PsToPdfFontPaths _arg1 = PsToPdfFontPathsHelper.read(_input);
                    boolean _arg2 = _input.read_boolean();
                    long _arg3 = _input.read_longlong();
                    _out = handler.createReply();
                    this.convertToPdf(_arg0, _arg1, _arg2, _arg3);
                }
                catch (PsToPdfFailureException _ex0) {
                    _out = handler.createExceptionReply();
                    PsToPdfFailureExceptionHelper.write(_out, _ex0);
                }
                break;
            }
            case 1: {
                try {
                    PsToPdfFontPaths _arg0 = PsToPdfFontPathsHelper.read(_input);
                    String _arg1 = _input.read_wstring();
                    _out = handler.createReply();
                    AvailableFontsHelper.write(_out, this.getFontsInFolder(_arg0, _arg1));
                }
                catch (PsToPdfFailureException _ex0) {
                    _out = handler.createExceptionReply();
                    PsToPdfFailureExceptionHelper.write(_out, _ex0);
                }
                break;
            }
            case 2: {
                try {
                    _out = handler.createReply();
                    _out.write_wstring(this.getColorProfilesDirectory());
                    break;
                }
                catch (PsToPdfFailureException _ex0) {
                    _out = handler.createExceptionReply();
                    PsToPdfFailureExceptionHelper.write(_out, _ex0);
                }
            }
        }
        return _out;
    }

    public String[] _all_interfaces(POA poa, byte[] obj_id) {
        return this.ids;
    }

    static {
        m_opsHash.put("convertToPdf", new Integer(0));
        m_opsHash.put("getFontsInFolder", new Integer(1));
        m_opsHash.put("getColorProfilesDirectory", new Integer(2));
    }
}