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

📄 cmppdeliver.java

📁 短信平台CMPP30 的JAVA程序,(含SQL数据库)
💻 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:   CMPPDeliver.java

package com.cmpp3_0.process;

import com.cmpp3_0.body.BodyDeliver;
import com.cmpp3_0.body.BodyDeliverStatusMsgContent;
import com.cmpp3_0.util.CMPPUtil;
import com.cmpp3_0.util.Logger;
import java.io.PrintStream;

public class CMPPDeliver
{

    private BodyDeliver bodyDeliver;

    public CMPPDeliver()
    {
        bodyDeliver = new BodyDeliver();
    }

    public BodyDeliver getBodyDeliver()
    {
        return bodyDeliver;
    }

    public int parseDeliver(byte body[], int seqId)
    {
        byte msgBytes[];
        int bodyLength = body.length;
        if(bodyLength < 97)
        {
            Logger.writeLog(-2, "接受到的短信包长度太短,不符合消息格式!!短信将被抛弃!!", "cmpp");
            return 4;
        }
        bodyDeliver.seqId = seqId;
        bodyDeliver.msgIdBytes = new byte[8];
        CMPPUtil.bytesCopy(body, bodyDeliver.msgIdBytes, 0, 8, 0);
        bodyDeliver.msgId = CMPPUtil.eightBytesToLong(bodyDeliver.msgIdBytes);
        byte dstIdBytes[] = new byte[21];
        CMPPUtil.deliveredBytesCopy(body, dstIdBytes, 8, 21, 0);
        bodyDeliver.dstId = (new String(dstIdBytes)).trim();
        byte serviceIdBytes[] = new byte[10];
        CMPPUtil.deliveredBytesCopy(body, serviceIdBytes, 29, 10, 0);
        bodyDeliver.serviceId = (new String(serviceIdBytes)).trim();
        bodyDeliver.tpPid = body[39];
        bodyDeliver.tpUdhi = body[40];
        bodyDeliver.msgFmt = body[41];
        byte srcTermIdBytes[] = new byte[32];
        CMPPUtil.deliveredBytesCopy(body, srcTermIdBytes, 42, 32, 0);
        bodyDeliver.srcTermId = (new String(srcTermIdBytes)).trim();
        bodyDeliver.srcTermType = body[74];
        bodyDeliver.registerDeliver = body[75];
        bodyDeliver.msgLength = body[76];
        System.out.println("length of delivered msg: " + bodyDeliver.msgLength);
        if(bodyLength < 97 + bodyDeliver.msgLength)
        {
            Logger.writeLog(-2, "接受到的短信包长度太短,不符合消息格式!!此短信将被抛弃!!!", "cmpp");
            return 4;
        }
        msgBytes = new byte[bodyDeliver.msgLength];
        CMPPUtil.bytesCopy(body, msgBytes, 77, bodyDeliver.msgLength, 0);
        if(bodyDeliver.registerDeliver != 1)
            break MISSING_BLOCK_LABEL_515;
        BodyDeliverStatusMsgContent bodyDeliverStatusMsgContent = new BodyDeliverStatusMsgContent();
        bodyDeliverStatusMsgContent.msgIdBytes = new byte[8];
        CMPPUtil.bytesCopy(msgBytes, bodyDeliverStatusMsgContent.msgIdBytes, 0, 8, 0);
        bodyDeliverStatusMsgContent.msgId = CMPPUtil.eightBytesToLong(bodyDeliverStatusMsgContent.msgIdBytes);
        bodyDeliverStatusMsgContent.stat = new String(msgBytes, 8, 7);
        bodyDeliverStatusMsgContent.submitTime = new String(msgBytes, 15, 10);
        bodyDeliverStatusMsgContent.doneTime = new String(msgBytes, 25, 10);
        bodyDeliverStatusMsgContent.dstTermId = new String(msgBytes, 35, 32);
        bodyDeliverStatusMsgContent.smscSeq = new String(msgBytes, 67, 4);
        bodyDeliver.bodyDeliverStatusMsgContent = bodyDeliverStatusMsgContent;
        break MISSING_BLOCK_LABEL_511;
        NumberFormatException nfe;
        nfe;
        System.out.println("由ISMG发送的状态报告中的SMSC_sequence字段不是整数!产生整数转型异常!");
        Logger.writeLog(-1, "由ISMG发送的状态报告中的SMSC_sequence字段不是整数!产生整数转型异常!", "cmpp");
        break MISSING_BLOCK_LABEL_534;
        bodyDeliver.msgContent = CMPPUtil.parseBytesToString(bodyDeliver.msgFmt, msgBytes);
        bodyDeliver.linkId = new String(body, 77 + bodyDeliver.msgLength, 20);
        return 0;
    }
}

⌨️ 快捷键说明

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