JML

net.sf.jqql.packets.out
Class FriendDataOpPacket

java.lang.Object
  extended by net.sf.jqql.packets.Packet
      extended by net.sf.jqql.packets.OutPacket
          extended by net.sf.jqql.packets.BasicOutPacket
              extended by net.sf.jqql.packets.out.FriendDataOpPacket

public class FriendDataOpPacket
extends BasicOutPacket

 upload, download friend note message packet, format:
 1. head
 2. subcommand, 1 byte
 3. page number, 1 byte, begin with 1. If it's 0, it means the field is not used now.
 4. QQ number of operation subject, 4 byte
 5. unknown 1 byte, 0x00
 6. below are note info, totally 7 fields, the filed order is :
     name, mobile, telephone, address, email, zipcode, note
    each field has a leading byte which indicates the length of the field.
 7. tail

 上传下载好友备注的消息包,格式为
 1. 头部
 2. 子命令,1字节
 3. 页号,1字节,从1开始,如果为0,表示此字段未用
 4. 操作对象的QQ号,4字节
 5. 未知1字节,0x00
 6. 以下为备注信息,一共7个域,域的顺序依次次是
    姓名、手机、电话、地址、邮箱、邮编、备注
    每个域都有一个前导字节,这个字节表示了这个域的字节长度
 7. 尾部
 
Note: If the subcommand is 0x00(download note in batch), there exist only part 2 and 3.
       If the subcommand is 0x01(upload note), there exist all parts and part 3 is not used yet.
       If the subcommand is 0x02(remove friend),  reserve part 1, 2, 4, 7 only.
       If the subcommand is 0x03(download note), reserve part 1, 2, 4, 7 only.

 Note: 如果子命令是0x00(批量下载备注),只有2,3部分
          如果子命令是0x01(上传备注),所有部分都要,3部分未用
       如果子命令是0x02(删除好友),仅保留1,2,4,7部分
       如果子命令是0x03(下载备注),仅保留1,2,4,7部分
 

Author:
luma

Field Summary
 
Fields inherited from class net.sf.jqql.packets.OutPacket
ack, key, resendCountDown, sendCount, seq, timeout
 
Fields inherited from class net.sf.jqql.packets.Packet
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user
 
Constructor Summary
FriendDataOpPacket(ByteBuffer buf, int length, QQUser user)
           
FriendDataOpPacket(QQUser user)
          constructor 构造函数
 
Method Summary
 String getAddress()
           
 String getEmail()
           
 String getMobile()
           
 String getName()
           
 String getNote()
           
 String getPacketName()
           
 int getPage()
           
 int getQQ()
           
 FriendRemark getRemark()
           
 byte getSubCommand()
           
 String getTelephone()
           
 String getZipcode()
           
protected  void parseBody(ByteBuffer buf)
          parse packet body, from begin position of buf 解析包体,从buf的开头位置解析起
protected  void putBody(ByteBuffer buf)
          initialize packet body 初始化包体
 void setAddress(String address)
           
 void setEmail(String email)
           
 void setMobile(String mobile)
           
 void setName(String name)
           
 void setNote(String note)
           
 void setPage(int page)
           
 void setQQ(int qqNum)
           
 void setRemark(FriendRemark remark)
           
 void setSubCommand(byte type)
           
 void setTelephone(String telephone)
           
 void setZipcode(String zipcode)
           
 
Methods inherited from class net.sf.jqql.packets.BasicOutPacket
decryptBody, encryptBody, getBodyBytes, getCryptographStart, getFamily, getHeadLength, getLength, getTailLength, parseHeader, parseTail, postFill, putHead, putTail, toString, validateHeader
 
Methods inherited from class net.sf.jqql.packets.OutPacket
dump, fill, getKey, getNextSeq, getSendCount, getTimeout, needAck, needResend, setKey, setSendCount, setTimeout
 
Methods inherited from class net.sf.jqql.packets.Packet
equals, getCommand, getHeader, getSequence, getSource, hash, hashCode, isDuplicated, setDuplicated, setHeader, setSequence
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FriendDataOpPacket

public FriendDataOpPacket(QQUser user)
constructor 构造函数


FriendDataOpPacket

public FriendDataOpPacket(ByteBuffer buf,
                          int length,
                          QQUser user)
                   throws PacketParseException
Parameters:
buf -
length -
Throws:
PacketParseException
Method Detail

getPacketName

public String getPacketName()
Overrides:
getPacketName in class BasicOutPacket
Returns:
descriptive name of packet 包的描述性名称

putBody

protected void putBody(ByteBuffer buf)
Description copied from class: Packet
initialize packet body 初始化包体

Specified by:
putBody in class Packet
Parameters:
buf - ByteBuffer

parseBody

protected void parseBody(ByteBuffer buf)
                  throws PacketParseException
Description copied from class: Packet
parse packet body, from begin position of buf 解析包体,从buf的开头位置解析起

Overrides:
parseBody in class OutPacket
Parameters:
buf - ByteBuffer
Throws:
PacketParseException - if parse error 如果解析出错

getAddress

public String getAddress()
Returns:
Returns the address.

setAddress

public void setAddress(String address)
Parameters:
address - The address to set.

getEmail

public String getEmail()
Returns:
Returns the email.

setEmail

public void setEmail(String email)
Parameters:
email - The email to set.

getMobile

public String getMobile()
Returns:
Returns the mobile.

setMobile

public void setMobile(String mobile)
Parameters:
mobile - The mobile to set.

getName

public String getName()
Returns:
Returns the name.

setName

public void setName(String name)
Parameters:
name - The name to set.

getNote

public String getNote()
Returns:
Returns the note.

setNote

public void setNote(String note)
Parameters:
note - The note to set.

getTelephone

public String getTelephone()
Returns:
Returns the telephone.

setTelephone

public void setTelephone(String telephone)
Parameters:
telephone - The telephone to set.

getZipcode

public String getZipcode()
Returns:
Returns the zipcode.

setZipcode

public void setZipcode(String zipcode)
Parameters:
zipcode - The zipcode to set.

getQQ

public int getQQ()
Returns:
Returns the qq.

setQQ

public void setQQ(int qqNum)
Parameters:
qq - The qq to set.

getRemark

public FriendRemark getRemark()
Returns:
Returns the remark.

setRemark

public void setRemark(FriendRemark remark)
Parameters:
remark - The remark to set.

getSubCommand

public byte getSubCommand()
Returns:
Returns the type.

setSubCommand

public void setSubCommand(byte type)
Parameters:
type - The type to set.

getPage

public int getPage()
Returns:
Returns the page.

setPage

public void setPage(int page)
Parameters:
page - The page to set.

JML