msgbindsr.java

来自「同步接收web services请求」· Java 代码 · 共 52 行

JAVA
52
字号
/**
 * 
 */
package com.aceway.vas.sjcraw.cbgp201;

import java.nio.ByteBuffer;

import com.aceway.vas.sjcraw.cbgp201.common.DataFormat;
import com.aceway.vas.sjcraw.cbgp201.common.MsgInfo;


/**
 * @标题: 华为彩铃平台接口规范
 * @说明: 
 * @版权: Copyright(c) 2007 
 * @公司: 北京汉铭信通科技有限公司 
 * @部门: 增值业务部 
 * @作者: 武达
 * @Jun 5, 2007
 */
public class MsgBindSr extends Msg {
	
	/*
Client Id	10	String	接入认证的用户名
AuthenticatorLength	4	Integer	认证码的长度
Authenticator	Max(9000)	String	认证码。为二进制数,所有字符均有效,包括空格
	*/
	
	private String clientId;
	private int authenticatorLength;
	private String authenticator;
	private static int operCode = MsgInfo.CRBT_BING_SR;
	
	public MsgBindSr(String seqNo, String linkId, String clientId, int authenticatorLength, String authenticator){
		super.setCommandLength(14+authenticatorLength);
		this.clientId = DataFormat.makeString(clientId, 10);
		this.authenticatorLength = authenticatorLength;
		this.authenticator = authenticator;
		super.setMsgHead(operCode, "0", seqNo, linkId);
		ByteBuffer buff = ByteBuffer.allocate(14+authenticatorLength);
		buff.put(this.clientId.getBytes());
		buff.putInt(this.authenticatorLength);
		buff.put(this.authenticator.getBytes());
		buff.flip();
		super.setMsgBody(buff.array());
	}
	



}

⌨️ 快捷键说明

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