⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sgipeventadapter.java

📁 华为java接口反编译结果!其中包含其所有接口实现过程
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   SGIPSMProxy.java

package com.huawei.smproxy;

import com.huawei.insa2.comm.*;
import com.huawei.insa2.comm.sgip.SGIPConnection;
import com.huawei.insa2.comm.sgip.SGIPTransaction;
import com.huawei.insa2.comm.sgip.message.*;

// Referenced classes of package com.huawei.smproxy:
//            SGIPSMProxy

class SGIPEventAdapter extends PEventAdapter
{

    private SGIPSMProxy smProxy;
    private SGIPConnection conn;

    public SGIPEventAdapter(SGIPSMProxy smProxy, SGIPConnection conn)
    {
        this.smProxy = null;
        this.conn = null;
        this.smProxy = smProxy;
        this.conn = conn;
    }

    public void childCreated(PLayer child)
    {
        SGIPTransaction t = (SGIPTransaction)child;
        SGIPMessage msg = t.getResponse();
        SGIPMessage resmsg = null;
        if(msg.getCommandId() == 2)
        {
            resmsg = new SGIPUnbindRepMessage();
            if(t.isChildOf(conn))
                smProxy.onTerminate();
        } else
        if(msg.getCommandId() == 1)
        {
            SGIPBindMessage tmpmes = (SGIPBindMessage)msg;
            int logintype = tmpmes.getLoginType();
            if(logintype != 2 && logintype != 11)
                resmsg = new SGIPBindRepMessage(4);
            resmsg = new SGIPBindRepMessage(0);
        } else
        if(msg.getCommandId() == 4)
        {
            SGIPDeliverMessage tmpmes = (SGIPDeliverMessage)msg;
            resmsg = smProxy.onDeliver(tmpmes);
        } else
        if(msg.getCommandId() == 5)
        {
            SGIPReportMessage tmpmes = (SGIPReportMessage)msg;
            resmsg = smProxy.onReport(tmpmes);
        } else
        if(msg.getCommandId() == 17)
        {
            SGIPUserReportMessage tmpmes = (SGIPUserReportMessage)msg;
            resmsg = smProxy.onUserReport(tmpmes);
        } else
        {
            t.close();
        }
        if(resmsg != null)
        {
            try
            {
                t.send(resmsg);
            }
            catch(PException e)
            {
                e.printStackTrace();
            }
            t.close();
        }
        if(msg.getCommandId() == 2)
        {
            SGIPConnection theconn = (SGIPConnection)t.getParent();
            theconn.close();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -