com.aspire.nm.component.cmppserver.filter.coder.packet
类 CmppPacket

java.lang.Object
  继承者 com.aspire.nm.component.cmppserver.filter.coder.packet.Packet
      继承者 com.aspire.nm.component.cmppserver.filter.coder.packet.CmppPacket
所有已实现的接口:
Serializable
直接已知子类:
CmppActiveTestPacket, CmppActiveTestRespPacket, CmppConnectPacket, CmppConnectRespPacket, CmppDeliverPacket, CmppDeliverRespPacket, CmppSubmitPacket, CmppSubmitRespPacket, CmppTerminatePacket, CmppTerminateRespPacket

public abstract class CmppPacket
extends Packet
implements Serializable

CMPP协议封包

从以下版本开始:
1.0.0
作者:
Wang Shenggong
另请参见:
序列化表格

字段摘要
 Object bizParams
           
static int CMPP_ACTIVE_TEST
           
static int CMPP_ACTIVE_TEST_LENGTH
           
static int CMPP_ACTIVE_TEST_RESP
           
static int CMPP_ACTIVE_TEST_RESP_LENGTH
           
static int CMPP_CANCEL
           
static int CMPP_CANCEL_LENGTH_V30
           
static int CMPP_CANCEL_RESP
           
static int CMPP_CANCEL_RESP_LENGTH_V30
           
static int CMPP_CONNECT
           
static int CMPP_CONNECT_LENGTH
           
static int CMPP_CONNECT_RESP
           
static int CMPP_CONNECT_RESP_LENGTH_V20
           
static int CMPP_CONNECT_RESP_LENGTH_V30
           
static int CMPP_DELIVER
           
static int CMPP_DELIVER_LENGTH_MIN_V20
           
static int CMPP_DELIVER_LENGTH_MIN_V30
           
static int CMPP_DELIVER_RESP
           
static int CMPP_DELIVER_RESP_LENGTH_V20
           
static int CMPP_DELIVER_RESP_LENGTH_V30
           
static int CMPP_QUERY
           
static int CMPP_QUERY_LENGTH_V30
           
static int CMPP_QUERY_RESP
           
static int CMPP_QUERY_RESP_LENGTH_V30
           
static int CMPP_SUBMIT
           
static int CMPP_SUBMIT_LENGTH_MIN_V20
           
static int CMPP_SUBMIT_LENGTH_MIN_V30
           
static int CMPP_SUBMIT_RESP
           
static int CMPP_SUBMIT_RESP_LENGTH_V20
           
static int CMPP_SUBMIT_RESP_LENGTH_V30
           
static int CMPP_TERMINATE
           
static int CMPP_TERMINATE_LENGTH
           
static int CMPP_TERMINATE_RESP
           
static int CMPP_TERMINATE_RESP_LENGTH
           
protected  int commandId
          CMPP指令标识
static int HEADER_LENGTH
           
protected  int sequenceId
          CMPP消息序号
protected  int totalLength
          CMPP封包长度
static CmppPacket UNKNOW_PACKET
          未知指令
static int USMP_PUSHNOTIFY
           
static int USMP_PUSHNOTIRY_LENGTH
           
static int USMP_PUSHNOTIRY_RESP
           
static int USMP_PUSHNOTIRY_RESP_LENGTH
           
static int USMP_SUBMITPUSH
           
static int USMP_SUBMITPUSH_LENGTH_MAX
           
static int USMP_SUBMITPUSH_LENGTH_MIN
           
static int USMP_SUBMITPUSH_RESP
           
static int USMP_SUBMITPUSH_RESP_LENGTH
           
protected  Version version
          解释封包所使用的CMPP版本
 
构造方法摘要
CmppPacket()
          构造CMPP封包
CmppPacket(Version version)
          用CMPP版本号初始化Cmpp封包
 
方法摘要
 int getCommandId()
           
 int getSequenceId()
           
 int getTotalLength()
           
protected  boolean isValidHeader()
          判断消息头是否为合法的CMPP消息头
 byte[] pack()
          封包, 将封包对象打包成网络传输的字节数组
 void setCommandId(int commandId)
           
 void setSequenceId(int sequenceId)
           
 void setTotalLength(int totalLength)
           
 void setVersion(Version version)
           
 CmppPacket unpack(ByteBuffer buffer)
          将底层字节数组解包成封包对象, 解包后对象本身相应的值发生改变被将自己返回
 
从类 com.aspire.nm.component.cmppserver.filter.coder.packet.Packet 继承的方法
allocate, get, get, get, get, getByteBuffer, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getString, put, put, put, put, put, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, putString, putString, putStringLeftPad, putStringRightPad, setByteBuffer, setBytes
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

bizParams

public Object bizParams

CMPP_CONNECT

public static final int CMPP_CONNECT
另请参见:
常量字段值

CMPP_CONNECT_LENGTH

public static final int CMPP_CONNECT_LENGTH
另请参见:
常量字段值

CMPP_CONNECT_RESP

public static final int CMPP_CONNECT_RESP
另请参见:
常量字段值

CMPP_CONNECT_RESP_LENGTH_V30

public static final int CMPP_CONNECT_RESP_LENGTH_V30
另请参见:
常量字段值

CMPP_CONNECT_RESP_LENGTH_V20

public static final int CMPP_CONNECT_RESP_LENGTH_V20
另请参见:
常量字段值

CMPP_TERMINATE

public static final int CMPP_TERMINATE
另请参见:
常量字段值

CMPP_TERMINATE_LENGTH

public static final int CMPP_TERMINATE_LENGTH
另请参见:
常量字段值

CMPP_TERMINATE_RESP

public static final int CMPP_TERMINATE_RESP
另请参见:
常量字段值

CMPP_TERMINATE_RESP_LENGTH

public static final int CMPP_TERMINATE_RESP_LENGTH
另请参见:
常量字段值

CMPP_SUBMIT

public static final int CMPP_SUBMIT
另请参见:
常量字段值

CMPP_SUBMIT_LENGTH_MIN_V30

public static final int CMPP_SUBMIT_LENGTH_MIN_V30
另请参见:
常量字段值

CMPP_SUBMIT_LENGTH_MIN_V20

public static final int CMPP_SUBMIT_LENGTH_MIN_V20
另请参见:
常量字段值

CMPP_SUBMIT_RESP

public static final int CMPP_SUBMIT_RESP
另请参见:
常量字段值

CMPP_SUBMIT_RESP_LENGTH_V30

public static final int CMPP_SUBMIT_RESP_LENGTH_V30
另请参见:
常量字段值

CMPP_SUBMIT_RESP_LENGTH_V20

public static final int CMPP_SUBMIT_RESP_LENGTH_V20
另请参见:
常量字段值

CMPP_DELIVER

public static final int CMPP_DELIVER
另请参见:
常量字段值

CMPP_DELIVER_LENGTH_MIN_V30

public static final int CMPP_DELIVER_LENGTH_MIN_V30
另请参见:
常量字段值

CMPP_DELIVER_LENGTH_MIN_V20

public static final int CMPP_DELIVER_LENGTH_MIN_V20
另请参见:
常量字段值

CMPP_DELIVER_RESP

public static final int CMPP_DELIVER_RESP
另请参见:
常量字段值

CMPP_DELIVER_RESP_LENGTH_V30

public static final int CMPP_DELIVER_RESP_LENGTH_V30
另请参见:
常量字段值

CMPP_DELIVER_RESP_LENGTH_V20

public static final int CMPP_DELIVER_RESP_LENGTH_V20
另请参见:
常量字段值

CMPP_QUERY

public static final int CMPP_QUERY
另请参见:
常量字段值

CMPP_QUERY_LENGTH_V30

public static final int CMPP_QUERY_LENGTH_V30
另请参见:
常量字段值

CMPP_QUERY_RESP

public static final int CMPP_QUERY_RESP
另请参见:
常量字段值

CMPP_QUERY_RESP_LENGTH_V30

public static final int CMPP_QUERY_RESP_LENGTH_V30
另请参见:
常量字段值

CMPP_CANCEL

public static final int CMPP_CANCEL
另请参见:
常量字段值

CMPP_CANCEL_LENGTH_V30

public static final int CMPP_CANCEL_LENGTH_V30
另请参见:
常量字段值

CMPP_CANCEL_RESP

public static final int CMPP_CANCEL_RESP
另请参见:
常量字段值

CMPP_CANCEL_RESP_LENGTH_V30

public static final int CMPP_CANCEL_RESP_LENGTH_V30
另请参见:
常量字段值

CMPP_ACTIVE_TEST

public static final int CMPP_ACTIVE_TEST
另请参见:
常量字段值

CMPP_ACTIVE_TEST_LENGTH

public static final int CMPP_ACTIVE_TEST_LENGTH
另请参见:
常量字段值

CMPP_ACTIVE_TEST_RESP

public static final int CMPP_ACTIVE_TEST_RESP
另请参见:
常量字段值

CMPP_ACTIVE_TEST_RESP_LENGTH

public static final int CMPP_ACTIVE_TEST_RESP_LENGTH
另请参见:
常量字段值

USMP_SUBMITPUSH

public static final int USMP_SUBMITPUSH
另请参见:
常量字段值

USMP_SUBMITPUSH_LENGTH_MIN

public static final int USMP_SUBMITPUSH_LENGTH_MIN
另请参见:
常量字段值

USMP_SUBMITPUSH_LENGTH_MAX

public static final int USMP_SUBMITPUSH_LENGTH_MAX
另请参见:
常量字段值

USMP_SUBMITPUSH_RESP

public static final int USMP_SUBMITPUSH_RESP
另请参见:
常量字段值

USMP_SUBMITPUSH_RESP_LENGTH

public static final int USMP_SUBMITPUSH_RESP_LENGTH
另请参见:
常量字段值

USMP_PUSHNOTIFY

public static final int USMP_PUSHNOTIFY
另请参见:
常量字段值

USMP_PUSHNOTIRY_LENGTH

public static final int USMP_PUSHNOTIRY_LENGTH
另请参见:
常量字段值

USMP_PUSHNOTIRY_RESP

public static final int USMP_PUSHNOTIRY_RESP
另请参见:
常量字段值

USMP_PUSHNOTIRY_RESP_LENGTH

public static final int USMP_PUSHNOTIRY_RESP_LENGTH
另请参见:
常量字段值

HEADER_LENGTH

public static final int HEADER_LENGTH
另请参见:
常量字段值

version

protected Version version
解释封包所使用的CMPP版本


commandId

protected int commandId
CMPP指令标识


sequenceId

protected int sequenceId
CMPP消息序号


totalLength

protected int totalLength
CMPP封包长度


UNKNOW_PACKET

public static CmppPacket UNKNOW_PACKET
未知指令

构造方法详细信息

CmppPacket

public CmppPacket()
构造CMPP封包


CmppPacket

public CmppPacket(Version version)
用CMPP版本号初始化Cmpp封包

参数:
version -
方法详细信息

isValidHeader

protected boolean isValidHeader()
判断消息头是否为合法的CMPP消息头

参数:
commandId -
返回:

pack

public byte[] pack()
            throws PacketException
封包, 将封包对象打包成网络传输的字节数组

返回:
打包后的字节数组
抛出:
PacketException

unpack

public CmppPacket unpack(ByteBuffer buffer)
                  throws PacketException
将底层字节数组解包成封包对象, 解包后对象本身相应的值发生改变被将自己返回

参数:
bytes - 字节数组
返回:
解包后的CmppPacket对象
抛出:
PacketException

getCommandId

public int getCommandId()
返回:
the commandId

setCommandId

public void setCommandId(int commandId)
参数:
commandId - the commandId to set

getSequenceId

public int getSequenceId()
返回:
the sequenceId

setSequenceId

public void setSequenceId(int sequenceId)
参数:
sequenceId - the sequenceId to set

getTotalLength

public int getTotalLength()
返回:
the totalLength

setTotalLength

public void setTotalLength(int totalLength)
参数:
totalLength - the totalLength to set

setVersion

public void setVersion(Version version)
参数:
version -


Copyright © 2016. All rights reserved.