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

📄 cmppsubmit.java

📁 移动短信网关接口源程序框架
💻 JAVA
字号:
// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2004-4-16 11:12:25
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   cmppSubmit.java

package com.aspire.cmppApi;

import java.io.*;

// Referenced classes of package com.aspire.cmppApi:
//            cmppCommon, cmppSocket

public class cmppSubmit
{

    public cmppSubmit(cmppSocket cmppsocket)
    {
        DestUsrTl = 1;
        pos = 299;
        Object obj = null;
        bodybytes = new byte[307];
        headbytes = new byte[12];
        pos = 299;
        CommandID = 4;
        TotalLength = 319;
        conn = cmppsocket;
        SequenceId = 0;
        MsgId = 1L;
        PkTotal = 0;
        PkNumber = 0;
        RegisteredDelivery = 1;
        MsgLevel = 1;
        ServiceId = "";
        FeeUserType = 1;
        feeterminalid = "";
        tppid = 0;
        tpudhi = 0;
        MsgFmt = 8;
        MsgSrc = "";
        FeeType = "";
        FeeCode = "";
        ValidTime = "";
        AtTime = "";
        SrcTerminalId = "";
        DestUsrTl = 1;
        DestTerminalId = "";
        MsgLength = 160;
        MsgContent = new byte[160];
        Reverse = "";
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(TotalLength), headbytes, 0, 3, 0);
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(CommandID), headbytes, 0, 3, 4);
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(SequenceId), headbytes, 0, 3, 8);
        int i = 0;
        cmppCommon.BytesCopy(cmppCommon.LongToBytes8(MsgId), bodybytes, 0, 7, i);
        i += 8;
        bodybytes[i] = (byte)PkTotal;
        i++;
        bodybytes[i] = (byte)PkNumber;
        i++;
        bodybytes[i] = (byte)RegisteredDelivery;
        i++;
        bodybytes[i] = (byte)MsgLevel;
        i++;
        byte abyte0[] = new byte[10];
        ServiceId.getBytes(0, ServiceId.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 9, i);
        i += 10;
        bodybytes[i] = (byte)FeeUserType;
        i++;
        abyte0 = new byte[21];
        feeterminalid.getBytes(0, feeterminalid.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 20, i);
        i += 21;
        bodybytes[i] = (byte)tppid;
        i++;
        bodybytes[i] = (byte)tpudhi;
        i++;
        bodybytes[i] = (byte)MsgFmt;
        i++;
        abyte0 = new byte[6];
        MsgSrc.getBytes(0, MsgSrc.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 5, i);
        i += 6;
        abyte0 = new byte[2];
        FeeType.getBytes(0, FeeType.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 1, i);
        i += 2;
        abyte0 = new byte[6];
        FeeCode.getBytes(0, FeeCode.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 5, i);
        i += 6;
        abyte0 = new byte[17];
        ValidTime.getBytes(0, ValidTime.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 16, i);
        i += 17;
        abyte0 = new byte[17];
        AtTime.getBytes(0, AtTime.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 16, i);
        i += 17;
        abyte0 = new byte[21];
        SrcTerminalId.getBytes(0, SrcTerminalId.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 20, i);
        i += 21;
        bodybytes[i] = (byte)DestUsrTl;
        i++;
        int j = 21 * DestUsrTl;
        abyte0 = new byte[j];
        DestTerminalId.getBytes(0, DestTerminalId.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, j - 1, i);
        i += j;
        bodybytes[i] = (byte)MsgLength;
        i++;
        cmppCommon.BytesCopy(MsgContent, bodybytes, 0, MsgLength - 1, i);
        i += MsgLength;
    }

    public int getTotalLength()
    {
        return TotalLength;
    }

    public int sendCmppSubmit()
    {
        int i = 0;
        synchronized(conn)
        {
            try
            {
                conn.bout.write(headbytes);
                byte abyte0[] = new byte[TotalLength - 12];
                cmppCommon.BytesCopy(bodybytes, abyte0, 0, TotalLength - 13, 0);
                conn.bout.write(abyte0);
                conn.bout.flush();
            }
            catch(IOException ioexception)
            {
                System.out.println(ioexception.toString());
                i = -5;
                int j = i;
                return j;
            }
        }
        return i;
    }

    public void setAtTime(String s)
    {
        AtTime = s;
        byte abyte0[] = new byte[17];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 16, 78);
    }

    public void setFeeCode(String s)
    {
        FeeCode = s;
        byte abyte0[] = new byte[6];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 5, 55);
    }

    public void setFeeType(String s)
    {
        FeeType = s;
        byte abyte0[] = new byte[2];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 1, 53);
    }

    public void setFeeUserType(int i)
    {
        FeeUserType = i;
        bodybytes[22] = (byte)i;
    }

    public void setFeeterminalid(String s)
    {
        feeterminalid = s;
        byte abyte0[] = new byte[21];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 20, 23);
    }

    public void setMsgFmt(int i)
    {
        MsgFmt = i;
        bodybytes[46] = (byte)i;
    }

    public void setMsgId(long l)
    {
        MsgId = l;
        cmppCommon.BytesCopy(cmppCommon.LongToBytes8(l), bodybytes, 0, 7, 0);
    }

    public void setMsgLevel(int i)
    {
        MsgLevel = i;
        bodybytes[11] = (byte)i;
    }

    public void setMsgSrc(String s)
    {
        MsgSrc = s;
        byte abyte0[] = new byte[6];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 5, 47);
    }

    public void setPkNumber(int i)
    {
        PkNumber = i;
        bodybytes[9] = (byte)i;
    }

    public void setPkTotal(int i)
    {
        PkTotal = i;
        bodybytes[8] = (byte)i;
    }

    public void setRegisteredDelivery(int i)
    {
        RegisteredDelivery = i;
        bodybytes[10] = (byte)i;
    }

    public void setRequiredItems(String s, int i, byte abyte0[])
    {
        Object obj = null;
        byte abyte1[] = null;
        MsgContent = abyte0;
        MsgLength = abyte0.length;
        DestTerminalId = s;
        byte abyte2[] = new byte[abyte0.length];
        for(int j = 0; j < abyte0.length; j++)
            abyte2[j] = abyte0[j];

        TotalLength = 147 + i + 12;
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(TotalLength), headbytes, 0, 3, 0);
        abyte1 = new byte[21];
        s.getBytes(0, s.length(), abyte1, 0);
        cmppCommon.BytesCopy(abyte1, bodybytes, 0, 20, 117);
        bodybytes[138] = (byte)i;
        cmppCommon.BytesCopy(abyte2, bodybytes, 0, i - 1, 139);
        abyte1 = new byte[8];
        Reverse.getBytes(0, Reverse.length(), abyte1, 0);
        cmppCommon.BytesCopy(abyte1, bodybytes, 0, 7, 139 + i);
        pos = 139 + i;
    }

    public void setReverse(String s)
    {
        Reverse = s;
        int i = pos;
        byte abyte0[] = new byte[8];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 7, i);
        i += 8;
    }

    public void setSequenceId(int i)
    {
        SequenceId = i;
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(i), headbytes, 0, 3, 8);
    }

    public void setServiceId(String s)
    {
        ServiceId = s;
        byte abyte0[] = new byte[10];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 9, 12);
    }

    public void setSrcTerminalId(String s)
    {
        SrcTerminalId = s;
        byte abyte0[] = new byte[21];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 20, 95);
    }

    public void setTppid(int i)
    {
        tppid = i;
        bodybytes[44] = (byte)i;
    }

    public void setTpudhi(int i)
    {
        tpudhi = i;
        bodybytes[45] = (byte)i;
    }

    public void setValidTime(String s)
    {
        ValidTime = s;
        byte abyte0[] = new byte[17];
        s.getBytes(0, s.length(), abyte0, 0);
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, 16, 61);
    }

    long MsgId;
    int PkTotal;
    int PkNumber;
    int RegisteredDelivery;
    int MsgLevel;
    String ServiceId;
    int FeeUserType;
    String feeterminalid;
    int tppid;
    int tpudhi;
    int MsgFmt;
    String MsgSrc;
    String FeeType;
    String FeeCode;
    String ValidTime;
    String AtTime;
    String SrcTerminalId;
    int DestUsrTl;
    String DestTerminalId;
    int MsgLength;
    byte MsgContent[];
    String Reverse;
    private int TotalLength;
    private int CommandID;
    private int SequenceId;
    public byte bodybytes[];
    public byte headbytes[];
    cmppSocket conn;
    int pos;
}

⌨️ 快捷键说明

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