/**
*
*/
package com.aceway.vas.sjcraw.cbgp201.crm.ruc;
import java.nio.ByteBuffer;
import com.aceway.vas.sjcraw.cbgp201.Msg;
import com.aceway.vas.sjcraw.cbgp201.common.DataFormat;
import com.aceway.vas.sjcraw.cbgp201.common.MsgInfo;
/**
* @標題: 華為彩鈴平臺接口規范
* @說明:
* @版權: Copyright(c) 2007
* @公司: 北京漢銘信通科技有限公司
* @部門: 增值業務部
* @作者: 武達
* @Jun 8, 2007
*/
public class MsgQueryRingSet extends Msg {
private static int operCode = MsgInfo.CRBT_QUERY_RINGSET;
private static int lenBody = MsgInfo.LEN_CRBT_QUERY_RINGSET;
/*
必選參數 AccountID 21 String 用戶手機號碼
RingSetObjType 1 Integer 鈴音設置的對象類型
0:查詢用戶所有的鈴音設置情況,UserGroupID、Phone字段無效
1:指定用戶組鈴音,Phone字段無效
2:指定主叫號碼鈴音,UserGroupID無效
UserGroupID 2 Integer 用戶組ID,當RingSetObjType=0和2時,本字段無效
Phone 21 String 用戶主叫號碼,當RingSetObjType=0和1時,本字段無效
Startnum 4 Integer 起始記錄數(第一次查詢填0)
可選參數 RequireNum 4 Interger 請求返回的最多記錄數
*/
private String accountId;
private int ringSetObjType;
private int userGroupId;
private String phone;
private int startNum;
private int requireNum;
public MsgQueryRingSet(String seqNo, String linkId, String accountId,
int ringSetObjType, int userGroupId, String phone, int requireNum){
this.accountId = DataFormat.makeString(accountId, 21);
this.ringSetObjType = ringSetObjType;
this.userGroupId = userGroupId;
this.phone = DataFormat.makeString(phone, 21);
this.startNum = startNum;
if (requireNum != 0){
this.requireNum = requireNum;
lenBody +=4;
}
super.setCommandLength(lenBody);
super.setMsgHead(operCode, "0", seqNo, linkId);
ByteBuffer buff = ByteBuffer.allocate(lenBody);
buff.put(this.accountId.getBytes());
buff.put((byte)this.ringSetObjType);
buff.put((byte)(this.userGroupId>>>8));
buff.put((byte)this.userGroupId);
buff.put(this.phone.getBytes());
buff.putInt(this.startNum);
if (buff.position()!=buff.limit()){
buff.putInt(this.requireNum);
}
buff.flip();
super.setMsgBody(buff.array());
}
}