JML

net.sf.jqql
Class QQClient

java.lang.Object
  extended by net.sf.jqql.QQClient
All Implemented Interfaces:
IQQListener

public class QQClient
extends Object
implements IQQListener

A class of QQ clinet, provid a convenient interface to user, for example send message , like that just need invoke a method to implement QQ的客户端类,这个类为用户提供一个方便的接口,比如发送消息之类的,只需要调用一个 方法便可以完成了。 network layer of Luma QQ was implemented by NIO , each Client allocate a Selector, every Selector can listening mulity Channel and channel was package in the implmented class of IPort, for a Client , there is a Main Port ,this one define as a port of connect QQ login server there is a port before login System ,also be Main port, according to require can start other port. LumaQQ网络层通过NIO实现,每个Client分配一个Selector,每个Selector可以监听多个 Channel,channel包装在IPort的实现类中,对于一个Client,有一个Main Port,这个 Main Port定义为连接QQ登陆服务器的那个Port。系统登陆之初之有一个Port即Main Port, 根据需要可以开启其他Port

Author:
luma

Field Summary
protected static SingleExecutor executor
          singnal thread processor 单线程执行器
protected  Map<InPacket,String> inConn
          è¾“入包和port的映射,用来判断一个包来自于哪个port
protected  ScheduledFuture<?> keepAliveFuture
           
protected  Runnable keepAliveTrigger
          Keep Alive过程
protected  Callable<Object> packetEventTrigger
          åŒ…事件触发过程
protected static int PROCESSOR_COUNT
          åŒ…处理器数目
protected  Queue<InPacket> receiveQueue
          æŽ¥æ”¶é˜Ÿåˆ—
protected  ResendTrigger<Object> resendTrigger
          é‡å‘过程
 
Constructor Summary
QQClient()
          constructor 构造函数
 
Method Summary
 void acceptSendFile(int receiver, int directPort, char sequence, boolean udp)
          send approve accept file package 发送同意接收文件包
 void activateCluster(int clusterId)
          activate cluster 激活群
 void activateTempCluster(byte type, int clusterId, int parentClusterId)
          activate temp cluster 激活临时群
 char addFriend(int qqNum)
          Add afriend 添加一个好友
 void addFriendToList(int group, int qqNum)
          æ·»åŠ å¥½å‹åˆ°æœåŠ¡å™¨ç«¯çš„å¥½å‹åˆ—è¡¨ä¸­
 void addIncomingPacket(InPacket packet, String portName)
          add a package to queue 添加一个包到接收队列
 void addQQListener(IQQListener listener)
          add a qq evnet listening 添加一个QQ事件监听器
 void addResendPacket(OutPacket packet, String port)
          add a package to resend queue 添加一个包到重发队列
 void applyDisk(String localIp)
          apply network hard disk 申请网络硬盘
 void approveAddMe(int qqNum)
          if i accept the request which a person who add me as friend use this method to send the approve message 如果我要同意一个人加我为好友的请求,用这个方法发送同意消息
 void approveJoinCluster(int clusterId, int receiver)
          Approve join into the cluster 同意加入群
 void authenticateDisk(String localIp, String nick, String password)
          authenticate network disk 网络硬盘认证
 void batchDownloadFriendRemark(int page)
          batch download remark of friend 批量下载好友备注
 void cancelDiskPassword(String localIp, String oldPassword)
          cancel the pass word of network hard disk 取消网络硬盘密码
 void cancelSendFile(int receiver, char sequence)
          cansel transport file 取消发送文件
 char commitMemberOrganization(int clusterId, List<Member> members)
          commit member organized 提交成员组织
 char commitOrganization(int clusterId, List<QQOrganization> organizations)
          commit structure of organized 提交组织架构
 void createDirectory(String localIp, String name, int parentId)
          create directory 创建目录
 void createFile(String localIp, String name, int parentId, int length)
          create file 创建文件
 void createPermanentCluster(String name, String notice, String description, List<Integer> members, int category, byte authType)
          create a fixed cluster 创建一个固定群
 char createTemporaryCluster(String name, byte type, int parentClusterId, List<Integer> members)
          create a temp cluster 创建一个临时群
 void deleteDirectory(String localIp, int id)
          delete directory 删除目录
 void deleteDirectory(String localIp, String id)
          delete directory 删除目录
 void deleteFile(String localIp, String id)
          delete file 删除文件
 char deleteFriend(int qqNum)
          delete a friend 删除一个好友
 void deleteShared(String localIp, int qq)
          cancel other share with self 取消某人对自己的共享
 char deleteSignature()
          delete the singnature 删除个性签名
 void detectHidden(int receiver)
          explore opposite whether is hidden...
 void dismissCluster(int clusterId)
          dismiss the cluster 解散群
 void downloadFile(String localIp, int diskOwner, String fileId, int offset, int length)
          dowmload file 下载一个文件
 void downloadFriend(int beginFrom)
          download the friends groupping 下载好友分组
 void downloadFriendRemark(int qqNum)
          download remark information of friend 下载好友备注信息
 void downloadGroup()
          download groupping 下载分组名称
 void exitCluster(int clusterId)
          exit a cluster 退出一个群
 void exitTempCluster(byte type, int clusterId, int parentClusterId)
          exit a temp cluster 退出一个临时群
 void finalizeUpload(String localIp, String id)
          finish the upload 结束上传
 void firePacketArrivedEvent(PacketEvent e)
          notify the package reach event to package processor 通知包处理器包到达事件
 void fireQQEvent(QQEvent e)
          fire QQ event 触发QQ事件
 String generateCrashReport(Throwable e, Packet p)
          when catch a Exceotion , generate a crash report 在程序出现运行时异常时产生一个崩溃报告
 void getCard(int clusterId, int qq)
          get the cluster Card which contain someone who is the member in thr cluster 得到某个成员的群名片
 void getCardBatch(int clusterId, int start)
          batch get the Cards of cluster 批量得到群名片
 void getClusterInfo(int clusterId)
          request for information of cluster 请求群的信息
 void getClusterMemberInfo(int clusterId, List<? extends Object> members)
          get the information of member in the cluster 得到群中成员的信息
 void getClusterOnlineMember(int clusterId)
          get the online members in the cluster 得到群的在线成员
 IConnection getConnection(InetSocketAddress address)
          according the remote address to get a port 根据远程地址得到一个port
 IConnection getConnection(String name)
          get a port 得到一个端口
 IConnectionPolicy getConnectionPolicy(InPacket in)
          get the policy of the input package that relate port 得到和某个输入包相关的端口策略
 IConnectionPolicyFactory getConnectionPolicyFactory()
           
 IConnectionPool getConnectionPool()
           
 IConnectionPoolFactory getConnectionPoolFactory()
           
 void getCustomHeadData(int qq, int timestamp, int offset, int length, String port)
          request get data of the custom head 请求得到自定义头像数据
 void getCustomHeadData(int qq, int timestamp, String port)
          request get the data of custom head 请求得到自定义头像数据
 void getCustomHeadInfo(List<Integer> qq, String port)
          request gte the information of custom face 请求得到自定义头像信息
 void getDialogList()
          requset get the list of muliti dialog 请求得到多人对话列表
 void getDiskServerList(String localIp)
          request get the list of network disk server 请求得到网络硬盘服务器列表
 void getFileSize(String localIp, String id)
          get the size of file 得到文件大小
 void getFriendLevel(List<Integer> friends)
          get the level of friend 得到好友等级
 void getFriendList()
          request to get the friends , if succesful ,will fire the event which are get Friend list success and get friend list end user need to listening the evnets to get all the informations of friend 请求取得好友名单,如果成功,将会触发get friend list successå’Œ get friend list end事件,用户需要监听这两个事件来得到所有的 好友信息
 void getFriendList(char position)
          request to get the friend list , the position point to the Offset that is beginning of list, suggest that elementary user do not use the API 请求取得好友名单,position指定了名单开始的偏移,建议初级用户不要使用此API
 void getFriendOnline()
          get the current online buddy list 请求取得当前在线好友列表
 void getFriendOnline(int startPosition)
          get the current online buddy list 请求取得当前在线好友列表
 String getLoginServer()
          ip of login server
 IConnectionPool getPortGate()
           
 int getProxyType()
           
 IRobot getRobot()
           
 void getSharedDisk(String localIp)
          get the share list of network dist 得到共享网络硬盘列表
 void getShareList(String localIp, int dirId)
          get the diretory which the list that share with many friend 得到某个目录对哪些好友共享的列表
 void getSignature(List<Signature> sigs)
          get the singnatrue 得到个性签名
 void getSubjectList(int clusterId)
          request get the list of discussion 请求得到讨论组列表
 void getTempClusterInfo(byte type, int clusterId, int parentClusterId)
          request message of temp cluster 请求临时群信息
 QQUser getUser()
           
 void getUserInfo(int qqNum)
          get the detial information of user 得到一个用户的详细信息
 void getUserProperty(char startPosition)
          get the property of user 得到用户属性
 char getWeather()
          request the weather forecast of self 请求自己这里的天气预报
 char getWeather(byte[] ip)
          request weather forecast 请求天气预报
 boolean isEmpty()
           
 boolean isLogging()
           
 boolean isRobotMode()
           
 char joinCluster(int clusterId)
          join into cluster 加入群
 void keepAlive()
          send keep alive package 发送keep alive包
 void listMyDiskDir(String localIp)
          show the directory of my network disk 列我的网络硬盘目录
 void listMyDiskDir(String localIp, int dirId, int unknown)
          show the directory of my network disk 列我的网络硬盘目录
 void listSharedDiskDir(String localIp, int diskOwner)
          show the share directory of network disk 列共享网络硬盘目录
 void login()
          login , use the defaul port 登陆,使用缺省端口
protected  void login(String server, int p)
          use the indicate server and port to login 用指定的服务器和端口登录
 void logout()
          exit the QQ dialog 退出QQ会话
 void makeMeAway()
          make my statu change to away 使我的状态改变成离开
 void makeMeHidden()
          make my statu change to hidden 使我的状态改变为隐身
 void makeMeOnline()
          make my statu change to online 使我的状态改变成在线
 void modifyCard(int clusterId, Card card)
          modify Card of cluster 修改群名片
 char modifyClusterInfo(int clusterId, String name, String notice, String description, int oldCategory, int category, byte authType)
          modify information of fixed cluster 修改固定群信息
 char modifyClusterMember(int clusterId, byte operation, List<Integer> members)
          modify member list of cluster 修改群的成员列表
 void modifyInfo(String oldPassword, String newPassword, ContactInfo contactInfo)
          modify personal information of user 修改用户的个人信息
 char modifySignature(String sig)
          modify singnature 修改个性签名
 char modifyTempClusterInfo(byte type, int clusterId, int parentClusterId, String name)
          modify information of temp cluster 修改临时群信息
 char modifyTempClusterMember(byte type, int clusterId, int parentClusterId, byte operation, List<Integer> members)
          modify information of temp cluster 修改临时群成员
 void moveDirectory(String localIp, int id, int fromId, int toId)
          move directory 移动目录
 void moveFile(String localIp, String id, int fromId, int toId)
          move file 移动文件
 void notifyFilePort(int receiver, int directPort, byte[] localIp, int localPort, char sequence)
          senf information package that is notity to port 发送通知端口信息包
 void pleaseConnectMe(int receiver, int directPort, char sequence)
          request opposite connect to me 请求对方连接我
 void prepareUpload(String localIp, String id)
          ready to uplaod 准备上传
 void qqEvent(QQEvent e)
          QQ event, user can get concrete event type from the variable type.
 void rejectAddMe(int qqNum, String message)
          if i wanna reject the request which a person wanna add me as friend , invoke this method to send the reject message 如果我要拒绝一个人加我为好友的请求,用这个方法发送拒绝消息
 void rejectJoinCluster(int clusterId, int receiver, String message)
          reject join the cluster 拒绝加入群
 void rejectSendFile(int receiver, char sequence, boolean udp)
          send package that is reject received file 发送拒绝接收文件包
 void release()
          release the QQClient , if not continute to use the QQClient , must release rhe resource by singleExecutor 释放这个QQClient,如果不继续使用QQClient,则必须释放此客户端以便 SingleExecutor释放资源
 void releaseConnection(String name)
          close a port 关闭一个端口
 void removeFriendFromList(int qqNum)
          æŠŠå¥½å‹ä»ŽæœåŠ¡å™¨ç«¯çš„å¥½å‹åˆ—è¡¨ä¸­åˆ é™¤
 InPacket removeIncomingPacket()
          received the first package in the queue , and remove it 从接收队列中得到第一个包,并且把这个包从队列中移除
 void removeQQListener(IQQListener listener)
          removed a QQ event listening 移去一个QQ事件监听器
 void removeResendPacket(InPacket packet)
          delete a resend package 删除一个重发包
 void removeSelfFrom(int qqNum)
          delete self from other's buddy list 把某人的好友列表中的自己删除
 void renameDirectory(String localIp, int id, String newName)
          rename a directory 重命名一个目录
 void renameDirectory(String localIp, String id, String newName)
          rename directory 重命名一个目录
 void renameFile(String localIp, String id, String newName)
          rename file 重命名一个文件
 char replyFaceData(int sessionId, String port)
          reply the data of face which transit server have received 回复中转服务器已经收到表情数据
 char requestAgent(int clusterId, int imageLength, byte[] md5, String fileName, String port)
          request transit server 请求中转服务器
 char requestData(int sessionId, String port)
          request to send the face picture data 请求发送表情图片数据
 char requestFace(int clusterId, int sessionId, byte[] key, String port)
          request to get the face picture 请求得到表情图片
 char requestJoinCluster(int clusterId, String message)
          request to join the cluster 请求加入群
 void requestKey(byte request)
          request the key 请求密钥
 char requestReceiveBegin(int sessionId, byte[] key, String port)
          request start to received session 请求开始接收会话
 void requestSendBegin(int sessionId, byte[] md5, String port)
          request start a session 请求开始一个会话
 char requestSendFile(int receiver, String filePath, int fileSize, int directPort, boolean udp)
          send request package which is transport file , return the package sequence as session sequence 发送传送文件请求包,我们把包序号用作会话序号返回
 char searchClusterById(int externalId)
          according external id to search the cluster 根据外部ID搜索群
 char searchDemoCluster()
          search the demo cluster 搜索示范群
 char searchUser(int page)
          search all the users who is online 搜索所有的在线用户
 char searchUser(int page, String qqStr, String nick, String email)
          custom search user 自定义搜索用户
 char searchUserAdvanced(int page, boolean online, boolean hasCam, int provinceIndex, int cityIndex, int ageIndex, int genderIndex)
           
 char sendAddFriendAuth(int qqNum, String message)
          if the person who we wanna add as friend need authorize ,use this method to send the authenticate request 如果要加的人需要认证,用这个方法发送验证请求
 void sendClusterIM(int clusterId, String message)
          send cluster message 发送群消息
 void sendClusterIM(int clusterId, String message, char messageId, int totalFragments, int fragmentSequence)
          send the message of fixed cluster 发送固定群消息
 void sendClusterIM(int clusterId, String message, char messageId, int totalFragments, int fragmentSequence, String fontName, boolean bold, boolean italic, boolean underline, int fontSize, int red, int green, int blue)
          send the message of fixed cluster 发送固定群消息
 void sendIM(int receiver, byte[] message)
          send a message , use the indicate font 发送一个消息,用给定的字体
 void sendIM(int receiver, byte[] message, byte replyType)
          send a message , can indicate the reply type 发送一条消息,可以指定回复类型
 void sendIM(int receiver, byte[] message, char messageId, int totalFragments, int fragementSequence, String fontName, boolean bold, boolean italic, boolean underline, int size, int red, int green, int blue, byte replyType)
          å‘送普通消息
 void sendIM(int receiver, byte[] message, String fontName, boolean bold, boolean italic, boolean underline, int size, int red, int green, int blue, byte replyType)
          send a message , indicate the font and color 发送一个消息,指定字体和字体颜色
 void sendPacket(OutPacket packet)
          General method , send a package this method use in the complex circs which some construct package , for example the package that upload the information of groupping the source of the data in the package is unknow ..
 void sendPacket(OutPacket packet, String port)
          send a pcakage by appoint to the port 通过指定port发送一个包
 void sendPacket(OutPacket packet, String port, boolean monitor)
          send a pcakage by appoint to the port 通过指定port发送一个包
 void sendPacketAnyway(OutPacket packet, String port)
          no matter whether is loginging , send the package anyway.
 char sendSMS(List<String> mobiles, List<Integer> qq, String senderName, byte[] message, char seq)
          send short message 发送短信
 void sendTempClusterIM(byte type, int clusterId, int parentClusterId, String message)
          send message of temp cluster 发送临时群消息
 void sendTempClusterIM(byte type, int clusterId, int parentClusterId, String message, char messageId, int totalFragments, int fragmentSequence)
          send message of temp cluster 发送临时群消息
 void sendTempClusterIM(byte type, int clusterId, int parentClusterId, String message, char messageId, int totalFragments, int fragmentSequence, String fontName, boolean bold, boolean italic, boolean underline, int fontSize, int red, int green, int blue)
          send message of temp cluster 发送临时群消息
 void sendTempSessionIM(int receiver, String message, String myNick)
          send the message of temp session 发送临时会话消息
 void sendTempSessionIM(int receiver, String message, String myNick, String fontName, boolean bold, boolean italic, boolean underline, int size, int red, int green, int blue)
          å‘送临时会话消息
 void setConnectionPolicyFactory(IConnectionPolicyFactory policyFactory)
           
 void setConnectionPoolFactory(IConnectionPoolFactory poolFactory)
           
 void setDiskPassword(String localIp, String oldPassword, String newPassword)
          set the pass word of network hard disk 设置网络硬盘密码
 void setLogging(boolean logging)
          set loginig logo 设置正在登陆标志
 void setLoginRedirect(boolean loginRedirect)
           
 void setLoginServer(String loginServer)
           
 void setMemberRole(int clusterId, int qq, byte opCode)
          set role of member in the cluster 设置群成员角色
 void setProxy(InetSocketAddress proxyAddress)
          set proxy server address 设置代理服务器地址
 void setProxyPassword(String password)
           
 void setProxyType(String type)
          set proxy type 设置代理类型
 void setProxyUsername(String username)
           
 void setRobot(IRobot robot)
           
 void setRobotMode(boolean robotMode)
          set robot statu 设置机器人状态
 void setSearchMeByQQOnly()
          set only can find me out by QQ number 设置仅能通过QQ号找到我
 void setTcpLoginPort(int tcpLoginPort)
           
 void setUser(QQUser user)
           
 void shareDirectory(String localIp, int dirId, List<Integer> remove, List<Integer> add)
          share the directory 共享某个目录
 void shareMyGeography()
          share my geographical position 共享我的地理位置
 char transferFaceData(int sessionId, byte[] fragment, boolean last, String port)
          send the face file data 传送表情文件数据
 char transferFaceInfo(int sessionId, int imageLength, String fileName, byte[] md5, String port)
          send the face file information 传送表情文件信息
 void transferRole(int clusterId, int qq)
          trnasfer role 转让身份
 void unsetSearchMeByQQOnly()
          cancel set only find me out by QQ number 取消设置仅能通过QQ号找到我
 void unshareDirectory(String localIp, int dirId, List<Integer> remove, List<Integer> add)
          cansel the direcotry that is share with others 取消共享某个目录
 void unshareMyGeography()
          not share my geographical position 不共享我的地理位置
 void updateOrganization(int clusterId)
          update structure of organized 更新组织架构
 void uploadFile(String localIp, String id, int offset, int length, byte[] bytes)
          upload file 上传文件
 void uploadFriendRemark(int qqNum, FriendRemark remark)
          upload remark information of friend 上传好友备注信息
 void uploadGroup(List<String> groups)
          upload groupping 上传分组名称
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

executor

protected static final SingleExecutor executor
singnal thread processor 单线程执行器


packetEventTrigger

protected Callable<Object> packetEventTrigger
包事件触发过程


resendTrigger

protected ResendTrigger<Object> resendTrigger
重发过程


keepAliveTrigger

protected Runnable keepAliveTrigger
Keep Alive过程


keepAliveFuture

protected ScheduledFuture<?> keepAliveFuture

receiveQueue

protected Queue<InPacket> receiveQueue
接收队列


inConn

protected Map<InPacket,String> inConn
输入包和port的映射,用来判断一个包来自于哪个port


PROCESSOR_COUNT

protected static final int PROCESSOR_COUNT
包处理器数目

See Also:
Constant Field Values
Constructor Detail

QQClient

public QQClient()
constructor 构造函数

Method Detail

getConnectionPolicy

public IConnectionPolicy getConnectionPolicy(InPacket in)
get the policy of the input package that relate port 得到和某个输入包相关的端口策略

Parameters:
in - reply package 回复包
Returns:
connect policy object 连接策略对象

setProxyType

public void setProxyType(String type)
set proxy type 设置代理类型

Parameters:
type -

getProxyType

public int getProxyType()
Returns:
proxy type 代理类型

setProxy

public void setProxy(InetSocketAddress proxyAddress)
set proxy server address 设置代理服务器地址

Parameters:
proxyAddress -

keepAlive

public void keepAlive()
send keep alive package 发送keep alive包


shareMyGeography

public void shareMyGeography()
share my geographical position 共享我的地理位置


unshareMyGeography

public void unshareMyGeography()
not share my geographical position 不共享我的地理位置


setSearchMeByQQOnly

public void setSearchMeByQQOnly()
set only can find me out by QQ number 设置仅能通过QQ号找到我


unsetSearchMeByQQOnly

public void unsetSearchMeByQQOnly()
cancel set only find me out by QQ number 取消设置仅能通过QQ号找到我


getWeather

public char getWeather(byte[] ip)
request weather forecast 请求天气预报

Parameters:
ip -

getWeather

public char getWeather()
request the weather forecast of self 请求自己这里的天气预报

Parameters:
ip -

uploadFriendRemark

public void uploadFriendRemark(int qqNum,
                               FriendRemark remark)
upload remark information of friend 上传好友备注信息

Parameters:
qqNum - QQ number of friend 好友的QQ号
remark -

downloadFriendRemark

public void downloadFriendRemark(int qqNum)
download remark information of friend 下载好友备注信息

Parameters:
qqNum - QQ number of friend 好友的QQ号

batchDownloadFriendRemark

public void batchDownloadFriendRemark(int page)
batch download remark of friend 批量下载好友备注

Parameters:
page - sequence

searchUserAdvanced

public char searchUserAdvanced(int page,
                               boolean online,
                               boolean hasCam,
                               int provinceIndex,
                               int cityIndex,
                               int ageIndex,
                               int genderIndex)
Parameters:
page -
online -
hasCam -
provinceIndex -
cityIndex -
ageIndex -
genderIndex -
Returns:

searchUser

public char searchUser(int page)
search all the users who is online 搜索所有的在线用户

Parameters:
page - sequence ,start 0
Returns:
package sequence

searchUser

public char searchUser(int page,
                       String qqStr,
                       String nick,
                       String email)
custom search user 自定义搜索用户

Parameters:
page - sequence
qqNum - String
nick - nickname of we wanna search the QQ user
email -
matchEntire - whether mathc the entire string
Returns:
pakcage sequence

addFriend

public char addFriend(int qqNum)
Add afriend 添加一个好友

Parameters:
qqNum - qq number who we wanna add
Returns:
package number which was sended

deleteFriend

public char deleteFriend(int qqNum)
delete a friend 删除一个好友

Parameters:
qqNum -
Returns:
if send package successful return the package sequence, 0else return 0

removeSelfFrom

public void removeSelfFrom(int qqNum)
delete self from other's buddy list 把某人的好友列表中的自己删除

Parameters:
qqNum - we wanna delete self in the other's buddy list

removeFriendFromList

public void removeFriendFromList(int qqNum)
把好友从服务器端的好友列表中删除

Parameters:
qqNum - 要删除的好友QQ号

addFriendToList

public void addFriendToList(int group,
                            int qqNum)
添加好友到服务器端的好友列表中

Parameters:
group - 好友的组号,我的好友组是0,然后是1,2,...
qqNum - 要添加的好友QQ号

sendAddFriendAuth

public char sendAddFriendAuth(int qqNum,
                              String message)
if the person who we wanna add as friend need authorize ,use this method to send the authenticate request 如果要加的人需要认证,用这个方法发送验证请求

Parameters:
qqNum - qq number of person who we wanna add as friend
message - the request addistional message
Returns:
package sequence

detectHidden

public void detectHidden(int receiver)
explore opposite whether is hidden...


requestSendFile

public char requestSendFile(int receiver,
                            String filePath,
                            int fileSize,
                            int directPort,
                            boolean udp)
send request package which is transport file , return the package sequence as session sequence 发送传送文件请求包,我们把包序号用作会话序号返回

Parameters:
filePath - the file name , but not caontian the path
fileSize -
directPort -
udp - true indicate by UDP
Returns:
session sequence of transport file

cancelSendFile

public void cancelSendFile(int receiver,
                           char sequence)
cansel transport file 取消发送文件

Parameters:
receiver -
sequence -

acceptSendFile

public void acceptSendFile(int receiver,
                           int directPort,
                           char sequence,
                           boolean udp)
send approve accept file package 发送同意接收文件包

Parameters:
receiver -
directPort - my directPort
sequence - the sequence of session
udp - true indicate by UDP

rejectSendFile

public void rejectSendFile(int receiver,
                           char sequence,
                           boolean udp)
send package that is reject received file 发送拒绝接收文件包

Parameters:
receiver -
sequence - session seqence
udp - true indicate UDP , else TCP

notifyFilePort

public void notifyFilePort(int receiver,
                           int directPort,
                           byte[] localIp,
                           int localPort,
                           char sequence)
senf information package that is notity to port 发送通知端口信息包

Parameters:
receiver -
directPort -
localIp -
localPort -
sequence -

pleaseConnectMe

public void pleaseConnectMe(int receiver,
                            int directPort,
                            char sequence)
request opposite connect to me 请求对方连接我

Parameters:
receiver -
directPort -
sequence -

rejectAddMe

public void rejectAddMe(int qqNum,
                        String message)
if i wanna reject the request which a person wanna add me as friend , invoke this method to send the reject message 如果我要拒绝一个人加我为好友的请求,用这个方法发送拒绝消息

Parameters:
qqNum - the qq number of a person who wanna add me as friend
the - additional message

approveAddMe

public void approveAddMe(int qqNum)
if i accept the request which a person who add me as friend use this method to send the approve message 如果我要同意一个人加我为好友的请求,用这个方法发送同意消息

Parameters:
qqNum - the qq number of someone who wanna add me as friend

downloadFriend

public void downloadFriend(int beginFrom)
download the friends groupping 下载好友分组

Parameters:
beginFrom - the number where is begin from 起始好友号

uploadGroup

public void uploadGroup(List<String> groups)
upload groupping 上传分组名称

Parameters:
groups -

downloadGroup

public void downloadGroup()
download groupping 下载分组名称


createTemporaryCluster

public char createTemporaryCluster(String name,
                                   byte type,
                                   int parentClusterId,
                                   List<Integer> members)
create a temp cluster 创建一个临时群

Parameters:
name - cluster's name
type - type of the temp cluster
parentClusterId - inner ID of parent cluster 父群内部ID
members -
Returns:
sequence of package

createPermanentCluster

public void createPermanentCluster(String name,
                                   String notice,
                                   String description,
                                   List<Integer> members,
                                   int category,
                                   byte authType)
create a fixed cluster 创建一个固定群

Parameters:
name - cluster's name
notice - notice of cluster
description - description of cluster
members - members in the cluster
authType - the type of authentication in the cluster
category - assort clusters

getClusterInfo

public void getClusterInfo(int clusterId)
request for information of cluster 请求群的信息

Parameters:
clusterId - cluster inner ID 群内部ID

setMemberRole

public void setMemberRole(int clusterId,
                          int qq,
                          byte opCode)
set role of member in the cluster 设置群成员角色

Parameters:
clusterId - cluster inner ID 群内部id
qq - the member that is need to set 需要设置的成员
opCode - Operatoin code

transferRole

public void transferRole(int clusterId,
                         int qq)
trnasfer role 转让身份

Parameters:
clusterId - cluster inner ID 群内部id
qq - who you wanna transfer the role to

getCardBatch

public void getCardBatch(int clusterId,
                         int start)
batch get the Cards of cluster 批量得到群名片

Parameters:
clusterId -
start -

getCard

public void getCard(int clusterId,
                    int qq)
get the cluster Card which contain someone who is the member in thr cluster 得到某个成员的群名片

Parameters:
clusterId -
qq -

modifyCard

public void modifyCard(int clusterId,
                       Card card)
modify Card of cluster 修改群名片

Parameters:
clusterId -
card -

updateOrganization

public void updateOrganization(int clusterId)
update structure of organized 更新组织架构

Parameters:
clusterId - cluster inner ID 群内部ID

commitOrganization

public char commitOrganization(int clusterId,
                               List<QQOrganization> organizations)
commit structure of organized 提交组织架构

Parameters:
clusterId -
organizations -

commitMemberOrganization

public char commitMemberOrganization(int clusterId,
                                     List<Member> members)
commit member organized 提交成员组织

Parameters:
clusterId -
members -
Returns:
sequence of package

getTempClusterInfo

public void getTempClusterInfo(byte type,
                               int clusterId,
                               int parentClusterId)
request message of temp cluster 请求临时群信息

Parameters:
type -
clusterId -
parentClusterId -

getClusterOnlineMember

public void getClusterOnlineMember(int clusterId)
get the online members in the cluster 得到群的在线成员

Parameters:
clusterId -

activateCluster

public void activateCluster(int clusterId)
activate cluster 激活群

Parameters:
clusterId -

activateTempCluster

public void activateTempCluster(byte type,
                                int clusterId,
                                int parentClusterId)
activate temp cluster 激活临时群

Parameters:
type -
clusterId -
parentClusterId -

getClusterMemberInfo

public void getClusterMemberInfo(int clusterId,
                                 List<? extends Object> members)
get the information of member in the cluster 得到群中成员的信息

Parameters:
clusterId - the inner ID of cluster
members - QQ number list of member, the type of elemnet is Inreger or Member 成员的QQ号列表,元素类型是Integer或者Member

modifyClusterMember

public char modifyClusterMember(int clusterId,
                                byte operation,
                                List<Integer> members)
modify member list of cluster 修改群的成员列表

Parameters:
clusterId -
operation - Type
members -
Returns:
sequence of package

modifyTempClusterMember

public char modifyTempClusterMember(byte type,
                                    int clusterId,
                                    int parentClusterId,
                                    byte operation,
                                    List<Integer> members)
modify information of temp cluster 修改临时群成员

Parameters:
type - of temp cluster
clusterId - of temp cluster 临时群id
parentClusterId - 父群ID
operation - type of operattion
members - 成员QQ号数组
Returns:
sequence of package

modifyClusterInfo

public char modifyClusterInfo(int clusterId,
                              String name,
                              String notice,
                              String description,
                              int oldCategory,
                              int category,
                              byte authType)
modify information of fixed cluster 修改固定群信息

Parameters:
clusterId - cluster Inner ID
name - of cluster
notice - of cluster
description - of cluster
oldCategory - cluster category at the old version 2004
category -
authType - authorize type of cluster
Returns:
sequence of package

modifyTempClusterInfo

public char modifyTempClusterInfo(byte type,
                                  int clusterId,
                                  int parentClusterId,
                                  String name)
modify information of temp cluster 修改临时群信息

Parameters:
type -
clusterId -
parentClusterId -
name -
Returns:

sendSMS

public char sendSMS(List<String> mobiles,
                    List<Integer> qq,
                    String senderName,
                    byte[] message,
                    char seq)
send short message 发送短信

Parameters:
mobiles - the moblie number of receiver 接受者的手机号码
qq - the qq number of receiver 接受者的QQ号码
senderName - 发送者名称
message - 消息字节数组
seq - sequence of message 消息序号
Returns:
sequence of package

sendClusterIM

public void sendClusterIM(int clusterId,
                          String message)
send cluster message 发送群消息

Parameters:
clusterId - the inner id of cluster
message - message content 消息内容

sendClusterIM

public void sendClusterIM(int clusterId,
                          String message,
                          char messageId,
                          int totalFragments,
                          int fragmentSequence)
send the message of fixed cluster 发送固定群消息

Parameters:
clusterId - the inner id of cluster 群内部ID
message - 消息
messageId - 消息id
totalFragments - the number of total fragments 分片数
fragmentSequence - 分片序号

sendClusterIM

public void sendClusterIM(int clusterId,
                          String message,
                          char messageId,
                          int totalFragments,
                          int fragmentSequence,
                          String fontName,
                          boolean bold,
                          boolean italic,
                          boolean underline,
                          int fontSize,
                          int red,
                          int green,
                          int blue)
send the message of fixed cluster 发送固定群消息

Parameters:
clusterId -
message -
messageId -
totalFragments -
fragmentSequence -
fontName -
bold -
italic -
underline -
fontSize -
red -
green -
blue -

sendTempClusterIM

public void sendTempClusterIM(byte type,
                              int clusterId,
                              int parentClusterId,
                              String message)
send message of temp cluster 发送临时群消息

Parameters:
type - type is temp cluster 临时群类型
clusterId - inner id of cluster 群内部id
parentClusterId - 父群id
message - 消息

sendTempClusterIM

public void sendTempClusterIM(byte type,
                              int clusterId,
                              int parentClusterId,
                              String message,
                              char messageId,
                              int totalFragments,
                              int fragmentSequence)
send message of temp cluster 发送临时群消息

Parameters:
type - type is temp cluster 临时群类型
clusterId - inner id of cluster 群内部id
parentClusterId - 父群id
message - 消息
messageId - 消息id
totalFragments - number of total fragments 分片数
fragmentSequence - 分片序号

sendTempClusterIM

public void sendTempClusterIM(byte type,
                              int clusterId,
                              int parentClusterId,
                              String message,
                              char messageId,
                              int totalFragments,
                              int fragmentSequence,
                              String fontName,
                              boolean bold,
                              boolean italic,
                              boolean underline,
                              int fontSize,
                              int red,
                              int green,
                              int blue)
send message of temp cluster 发送临时群消息

Parameters:
type -
clusterId -
parentClusterId -
message -
messageId -
totalFragments -
fragmentSequence -
fontName -
bold -
italic -
underline -
fontSize -
red -
green -
blue -

exitCluster

public void exitCluster(int clusterId)
exit a cluster 退出一个群

Parameters:
clusterId - inner id of cluster 群内部ID

dismissCluster

public void dismissCluster(int clusterId)
dismiss the cluster 解散群

Parameters:
clusterId -

exitTempCluster

public void exitTempCluster(byte type,
                            int clusterId,
                            int parentClusterId)
exit a temp cluster 退出一个临时群

Parameters:
type -
clusterId -
parentClusterId -

searchClusterById

public char searchClusterById(int externalId)
according external id to search the cluster 根据外部ID搜索群

Parameters:
externalId - external id of cluster 群的外部ID
Returns:
package sequence 包序号

searchDemoCluster

public char searchDemoCluster()
search the demo cluster 搜索示范群

Returns:
package sequence 包序号

joinCluster

public char joinCluster(int clusterId)
join into cluster 加入群

Parameters:
clusterId -
Returns:
package sequence 包序号

requestJoinCluster

public char requestJoinCluster(int clusterId,
                               String message)
request to join the cluster 请求加入群

Parameters:
clusterId - inner id of cluster 群内部ID
message - addtional message of request 请求的附加信息
Returns:
package sequence 包序号

approveJoinCluster

public void approveJoinCluster(int clusterId,
                               int receiver)
Approve join into the cluster 同意加入群

Parameters:
clusterId -

rejectJoinCluster

public void rejectJoinCluster(int clusterId,
                              int receiver,
                              String message)
reject join the cluster 拒绝加入群

Parameters:
clusterId -
message -

modifyInfo

public void modifyInfo(String oldPassword,
                       String newPassword,
                       ContactInfo contactInfo)
modify personal information of user 修改用户的个人信息

Parameters:
oldPassword - the old pass word , if do not changed it ,set it null 老密码,如果不修改密码,设成null
newPassword - the new pass word, if do not changed it ,set it null 新密码,如果不修改密码,设成null
contactInfo - other information 其他信息

modifySignature

public char modifySignature(String sig)
modify singnature 修改个性签名

Parameters:
sig - singnature 个性签名

deleteSignature

public char deleteSignature()
delete the singnature 删除个性签名


getSignature

public void getSignature(List<Signature> sigs)
get the singnatrue 得到个性签名

Parameters:
sigs -

getFriendLevel

public void getFriendLevel(List<Integer> friends)
get the level of friend 得到好友等级

Parameters:
friends -

getUserInfo

public void getUserInfo(int qqNum)
get the detial information of user 得到一个用户的详细信息

Parameters:
qqNum - the number of user that we wanna get 想要得到的用户QQ号

getFriendList

public void getFriendList()
request to get the friends , if succesful ,will fire the event which are get Friend list success and get friend list end user need to listening the evnets to get all the informations of friend 请求取得好友名单,如果成功,将会触发get friend list success和 get friend list end事件,用户需要监听这两个事件来得到所有的 好友信息


getFriendList

public void getFriendList(char position)
request to get the friend list , the position point to the Offset that is beginning of list, suggest that elementary user do not use the API 请求取得好友名单,position指定了名单开始的偏移,建议初级用户不要使用此API

Parameters:
position -

getFriendOnline

public void getFriendOnline()
get the current online buddy list 请求取得当前在线好友列表


getFriendOnline

public void getFriendOnline(int startPosition)
get the current online buddy list 请求取得当前在线好友列表


getUserProperty

public void getUserProperty(char startPosition)
get the property of user 得到用户属性

Parameters:
startPosition -

makeMeOnline

public void makeMeOnline()
make my statu change to online 使我的状态改变成在线


makeMeAway

public void makeMeAway()
make my statu change to away 使我的状态改变成离开


makeMeHidden

public void makeMeHidden()
make my statu change to hidden 使我的状态改变为隐身


requestKey

public void requestKey(byte request)
request the key 请求密钥

Parameters:
request -

getDialogList

public void getDialogList()
requset get the list of muliti dialog 请求得到多人对话列表


getSubjectList

public void getSubjectList(int clusterId)
request get the list of discussion 请求得到讨论组列表

Parameters:
clusterId - cluster Id

sendPacket

public void sendPacket(OutPacket packet)
General method , send a package this method use in the complex circs which some construct package , for example the package that upload the information of groupping the source of the data in the package is unknow .. 通用方法,发送一个packet 这个方法用在一些包构造比较复杂的情况下,比如上传分组信息这种包, 包中数据的来源是无法知道的也不是用几个参数就能概括的,可能也和实现有关。

Parameters:
packet - sub class of the OutPacket OutPacket子类

sendPacket

public void sendPacket(OutPacket packet,
                       String port)
send a pcakage by appoint to the port 通过指定port发送一个包

Parameters:
packet -
port -

sendPacket

public void sendPacket(OutPacket packet,
                       String port,
                       boolean monitor)
send a pcakage by appoint to the port 通过指定port发送一个包

Parameters:
packet - output package object 输出包对象
port - port name port名称
monitor - true mean add to listening buffer of package true表示加入到包监视缓冲

sendPacketAnyway

public void sendPacketAnyway(OutPacket packet,
                             String port)
no matter whether is loginging , send the package anyway. 不管有没有登录,都把包发出去

Parameters:
packet -
port -

getLoginServer

public String getLoginServer()
ip of login server

Returns:
登陆服务器IP

getUser

public QQUser getUser()
Returns:
Returns the user.

addQQListener

public void addQQListener(IQQListener listener)
add a qq evnet listening 添加一个QQ事件监听器

Parameters:
listener - QQListener

removeQQListener

public void removeQQListener(IQQListener listener)
removed a QQ event listening 移去一个QQ事件监听器

Parameters:
listener - QQListener

fireQQEvent

public void fireQQEvent(QQEvent e)
fire QQ event 触发QQ事件

Parameters:
e - QQEvent

login

public void login()
           throws Exception
login , use the defaul port 登陆,使用缺省端口

Throws:
Exception - if login occur error ,throw the Exception 如果登录出错

login

protected void login(String server,
                     int p)
              throws Exception
use the indicate server and port to login 用指定的服务器和端口登录

Parameters:
server - login server
p - the port for login
Throws:
Exception - if login occur error ,throw the Exception 如果登录出错

logout

public void logout()
exit the QQ dialog 退出QQ会话


release

public void release()
release the QQClient , if not continute to use the QQClient , must release rhe resource by singleExecutor 释放这个QQClient,如果不继续使用QQClient,则必须释放此客户端以便 SingleExecutor释放资源


qqEvent

public void qqEvent(QQEvent e)
Description copied from interface: IQQListener
QQ event, user can get concrete event type from the variable type. QQ事件,用户可以获取type变量得到具体的事件类型

Specified by:
qqEvent in interface IQQListener
Parameters:
e - QQEvent

sendTempSessionIM

public void sendTempSessionIM(int receiver,
                              String message,
                              String myNick)
send the message of temp session 发送临时会话消息

Parameters:
receiver -
message -

sendTempSessionIM

public void sendTempSessionIM(int receiver,
                              String message,
                              String myNick,
                              String fontName,
                              boolean bold,
                              boolean italic,
                              boolean underline,
                              int size,
                              int red,
                              int green,
                              int blue)
发送临时会话消息

Parameters:
receiver -
message -
fontName -
bold -
italic -
underline -
size -
red -
green -
blue -

sendIM

public void sendIM(int receiver,
                   byte[] message)
send a message , use the indicate font 发送一个消息,用给定的字体

Parameters:
receiver - the qq number of receiver 接受者QQ号
message - 消息
fontName - 字体

sendIM

public void sendIM(int receiver,
                   byte[] message,
                   byte replyType)
send a message , can indicate the reply type 发送一条消息,可以指定回复类型

Parameters:
receiver - the qq number of receiver 接收者QQ号
message - 消息
fontName - 字体名
replyType - reply type , normal or automatic 回复方式,正常回复还是自动回复

sendIM

public void sendIM(int receiver,
                   byte[] message,
                   String fontName,
                   boolean bold,
                   boolean italic,
                   boolean underline,
                   int size,
                   int red,
                   int green,
                   int blue,
                   byte replyType)
send a message , indicate the font and color 发送一个消息,指定字体和字体颜色

Parameters:
receiver - 接受者QQ号
message - 消息
fontName - 字体
bold - 是否粗体
italic - 是否斜体
underline - 是否下划线
size - 字体大小,最大是31
red - 颜色Red
green - 颜色Green
blue - 颜色Blue
replyType - reply type , normal or automatic 回复类型,自动回复还是正常回复

sendIM

public void sendIM(int receiver,
                   byte[] message,
                   char messageId,
                   int totalFragments,
                   int fragementSequence,
                   String fontName,
                   boolean bold,
                   boolean italic,
                   boolean underline,
                   int size,
                   int red,
                   int green,
                   int blue,
                   byte replyType)
发送普通消息

Parameters:
receiver -
message -
messageId -
totalFragments -
fragementSequence -
fontName -
bold -
italic -
underline -
size -
red -
green -
blue -
replyType -

setLoginServer

public void setLoginServer(String loginServer)
Parameters:
loginServer - the ip string of login server 登陆服务器IP

setUser

public void setUser(QQUser user)
Parameters:
user - The user to set.

isLogging

public boolean isLogging()
Returns:
Returns the logging.

setProxyPassword

public void setProxyPassword(String password)
Parameters:
password - The password to set.

setProxyUsername

public void setProxyUsername(String username)
Parameters:
username - The username to set.

setLoginRedirect

public void setLoginRedirect(boolean loginRedirect)
Parameters:
loginRedirect - The loginRedirect to set.

setTcpLoginPort

public void setTcpLoginPort(int tcpLoginPort)
Parameters:
tcpLoginPort - The tcpLoginPort to set.

isRobotMode

public boolean isRobotMode()
Returns:
true indicate is robot statu

setRobotMode

public void setRobotMode(boolean robotMode)
set robot statu 设置机器人状态

Parameters:
robotMode -

setLogging

public void setLogging(boolean logging)
set loginig logo 设置正在登陆标志

Parameters:
logging -

addIncomingPacket

public void addIncomingPacket(InPacket packet,
                              String portName)
add a package to queue 添加一个包到接收队列

Parameters:
packet -

removeIncomingPacket

public InPacket removeIncomingPacket()
received the first package in the queue , and remove it 从接收队列中得到第一个包,并且把这个包从队列中移除

Returns:
received the first package in the queue , if no , return null 接收队列的第一个包,没有返回null

isEmpty

public boolean isEmpty()
Returns:
true indicate the received queue is null

firePacketArrivedEvent

public void firePacketArrivedEvent(PacketEvent e)
notify the package reach event to package processor 通知包处理器包到达事件

Parameters:
e -

getPortGate

public IConnectionPool getPortGate()
Returns:
Returns the portGate.

removeResendPacket

public void removeResendPacket(InPacket packet)
delete a resend package 删除一个重发包

Parameters:
packet -

addResendPacket

public void addResendPacket(OutPacket packet,
                            String port)
add a package to resend queue 添加一个包到重发队列

Parameters:
packet -
port -

releaseConnection

public void releaseConnection(String name)
close a port 关闭一个端口

Parameters:
name - port name 端口名称

getConnection

public IConnection getConnection(String name)
get a port 得到一个端口

Parameters:
name - port name 端口名
Returns:
IPort object , if not exist , return null IPort对象,如果不存在,则返回null

getConnection

public IConnection getConnection(InetSocketAddress address)
according the remote address to get a port 根据远程地址得到一个port

Parameters:
address - romote port address 端口远程地址
Returns:
IPort object , if not exist , return null IPort对象,如果不存在,返回null

requestAgent

public char requestAgent(int clusterId,
                         int imageLength,
                         byte[] md5,
                         String fileName,
                         String port)
request transit server 请求中转服务器

Parameters:
clusterId - inner id of cluster 群内部ID
imageLength - length of image 图片大小
md5 - md5 of image 图片md5
port - port name 端口名称
Returns:
sequence of package 包序号

requestSendBegin

public void requestSendBegin(int sessionId,
                             byte[] md5,
                             String port)
request start a session 请求开始一个会话

Parameters:
sessionId - id of session 会话id
port - port name 端口名称

requestReceiveBegin

public char requestReceiveBegin(int sessionId,
                                byte[] key,
                                String port)
request start to received session 请求开始接收会话

Parameters:
sessionId -
key -
port -
Returns:

requestData

public char requestData(int sessionId,
                        String port)
request to send the face picture data 请求发送表情图片数据

Parameters:
port -
Returns:

replyFaceData

public char replyFaceData(int sessionId,
                          String port)
reply the data of face which transit server have received 回复中转服务器已经收到表情数据

Parameters:
sessionId -
port -
Returns:

transferFaceInfo

public char transferFaceInfo(int sessionId,
                             int imageLength,
                             String fileName,
                             byte[] md5,
                             String port)
send the face file information 传送表情文件信息

Parameters:
sessionId -
imageLength -
fileName -
md5 -
port -
Returns:
package sequence 包序号

transferFaceData

public char transferFaceData(int sessionId,
                             byte[] fragment,
                             boolean last,
                             String port)
send the face file data 传送表情文件数据

Parameters:
sessionId -
fragment -
last -
port -
Returns:
package sequence 包序号

requestFace

public char requestFace(int clusterId,
                        int sessionId,
                        byte[] key,
                        String port)
request to get the face picture 请求得到表情图片

Parameters:
clusterId -
sessionId -
agentToken -
key -
Returns:

getCustomHeadInfo

public void getCustomHeadInfo(List<Integer> qq,
                              String port)
request gte the information of custom face 请求得到自定义头像信息

Parameters:
qq - qq number list of request 请求的QQ号列表
port - send port 发送端口名

getCustomHeadData

public void getCustomHeadData(int qq,
                              int timestamp,
                              String port)
request get the data of custom head 请求得到自定义头像数据

Parameters:
qq -
timestamp -
port -

getCustomHeadData

public void getCustomHeadData(int qq,
                              int timestamp,
                              int offset,
                              int length,
                              String port)
request get data of the custom head 请求得到自定义头像数据

Parameters:
qq -
timestamp -
offset -
length -
port -

getDiskServerList

public void getDiskServerList(String localIp)
request get the list of network disk server 请求得到网络硬盘服务器列表

Parameters:
localIp -

authenticateDisk

public void authenticateDisk(String localIp,
                             String nick,
                             String password)
authenticate network disk 网络硬盘认证

Parameters:
localIp - 本地ip
nick - 昵称
password - 密码,如果没有密码,置为null

getSharedDisk

public void getSharedDisk(String localIp)
get the share list of network dist 得到共享网络硬盘列表

Parameters:
localIp -

listSharedDiskDir

public void listSharedDiskDir(String localIp,
                              int diskOwner)
show the share directory of network disk 列共享网络硬盘目录

Parameters:
localIp -
diskOwner -

listMyDiskDir

public void listMyDiskDir(String localIp)
show the directory of my network disk 列我的网络硬盘目录

Parameters:
localIp -

listMyDiskDir

public void listMyDiskDir(String localIp,
                          int dirId,
                          int unknown)
show the directory of my network disk 列我的网络硬盘目录

Parameters:
localIp -
dirId -

setDiskPassword

public void setDiskPassword(String localIp,
                            String oldPassword,
                            String newPassword)
set the pass word of network hard disk 设置网络硬盘密码

Parameters:
localIp -
oldPassword -
newPassword -

cancelDiskPassword

public void cancelDiskPassword(String localIp,
                               String oldPassword)
cancel the pass word of network hard disk 取消网络硬盘密码

Parameters:
localIp -
oldPassword -

downloadFile

public void downloadFile(String localIp,
                         int diskOwner,
                         String fileId,
                         int offset,
                         int length)
dowmload file 下载一个文件

Parameters:
localIp -
diskOwner -
fileId -
offset -
length -

renameFile

public void renameFile(String localIp,
                       String id,
                       String newName)
rename file 重命名一个文件

Parameters:
localIp -
id -
newName -

renameDirectory

public void renameDirectory(String localIp,
                            int id,
                            String newName)
rename a directory 重命名一个目录

Parameters:
localIp -
id -
newName -

renameDirectory

public void renameDirectory(String localIp,
                            String id,
                            String newName)
rename directory 重命名一个目录

Parameters:
localIp -
id -
newName -

deleteFile

public void deleteFile(String localIp,
                       String id)
delete file 删除文件

Parameters:
localIp -
id -

deleteDirectory

public void deleteDirectory(String localIp,
                            int id)
delete directory 删除目录

Parameters:
localIp -
id -

deleteDirectory

public void deleteDirectory(String localIp,
                            String id)
delete directory 删除目录

Parameters:
localIp -
id -

deleteShared

public void deleteShared(String localIp,
                         int qq)
cancel other share with self 取消某人对自己的共享

Parameters:
localIp -
qq -

createDirectory

public void createDirectory(String localIp,
                            String name,
                            int parentId)
create directory 创建目录

Parameters:
localIp -
name -
parentId -

createFile

public void createFile(String localIp,
                       String name,
                       int parentId,
                       int length)
create file 创建文件

Parameters:
localIp -
name -
parentId -
length -

moveFile

public void moveFile(String localIp,
                     String id,
                     int fromId,
                     int toId)
move file 移动文件

Parameters:
localIp -
id -
fromId -
toId -

moveDirectory

public void moveDirectory(String localIp,
                          int id,
                          int fromId,
                          int toId)
move directory 移动目录

Parameters:
localIp -
id -
fromId -
toId -

uploadFile

public void uploadFile(String localIp,
                       String id,
                       int offset,
                       int length,
                       byte[] bytes)
upload file 上传文件

Parameters:
localIp -
id -
offset -
length -
bytes -

finalizeUpload

public void finalizeUpload(String localIp,
                           String id)
finish the upload 结束上传

Parameters:
localIp -
id -

prepareUpload

public void prepareUpload(String localIp,
                          String id)
ready to uplaod 准备上传

Parameters:
localIp -
id -

getFileSize

public void getFileSize(String localIp,
                        String id)
get the size of file 得到文件大小

Parameters:
localIp -
id -

getShareList

public void getShareList(String localIp,
                         int dirId)
get the diretory which the list that share with many friend 得到某个目录对哪些好友共享的列表

Parameters:
localIp -
dirId -

shareDirectory

public void shareDirectory(String localIp,
                           int dirId,
                           List<Integer> remove,
                           List<Integer> add)
share the directory 共享某个目录

Parameters:
localIp -
dirId -
remove -
add -

unshareDirectory

public void unshareDirectory(String localIp,
                             int dirId,
                             List<Integer> remove,
                             List<Integer> add)
cansel the direcotry that is share with others 取消共享某个目录

Parameters:
localIp -
dirId -
remove -
add -

applyDisk

public void applyDisk(String localIp)
apply network hard disk 申请网络硬盘

Parameters:
localIp -

setRobot

public void setRobot(IRobot robot)
Parameters:
robot - The robot to set.

getRobot

public IRobot getRobot()
Returns:
Returns the robot.

generateCrashReport

public String generateCrashReport(Throwable e,
                                  Packet p)
when catch a Exceotion , generate a crash report 在程序出现运行时异常时产生一个崩溃报告

Parameters:
e - exceptoin object 异常对象
p - package object 包对象
Returns:
content of crash report 崩溃报告内容

getConnectionPolicyFactory

public IConnectionPolicyFactory getConnectionPolicyFactory()
Returns:
the policyFactory

setConnectionPolicyFactory

public void setConnectionPolicyFactory(IConnectionPolicyFactory policyFactory)
Parameters:
policyFactory - the policyFactory to set

getConnectionPool

public IConnectionPool getConnectionPool()
Returns:
the pool

getConnectionPoolFactory

public IConnectionPoolFactory getConnectionPoolFactory()
Returns:
the poolFactory

setConnectionPoolFactory

public void setConnectionPoolFactory(IConnectionPoolFactory poolFactory)
Parameters:
poolFactory - the poolFactory to set

JML