|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jqql.obsolete.FileWatcher
public abstract class FileWatcher
file wathcer, take charge to manage once file transfer 文件守望者,负责管理一次文件传输
Field Summary | |
---|---|
protected ByteBuffer |
buffer
|
protected int |
condition
|
protected FileControlPacket |
fcp
|
protected FileDataPacket |
fdp
|
protected byte[] |
fileAgentKey
|
protected byte[] |
fileAgentToken
|
protected byte[] |
fileMD5
|
protected String |
fileName
|
protected byte[] |
fileNameMD5
|
protected int |
fileSize
|
protected int |
fileTransferStatus
|
protected int |
fragments
|
static int |
FT_NEGOTIATING
|
static int |
FT_NONE
|
static int |
FT_RECEIVING
|
static int |
FT_SAYING_HELLO
|
static int |
FT_SENDING
|
static int |
FT_SENDING_BASIC
|
static int |
FT_SENDING_EOF
|
protected byte[] |
hisFileSessionKey
|
protected byte[] |
hisInternetIp
|
protected int |
hisInternetPort
|
protected byte[] |
hisLocalIp
|
protected int |
hisMajorPort
|
protected int |
hisMinorPort
|
protected int |
hisQQ
|
protected List<IFileListener> |
listeners
|
protected RandomAccessFile |
localFile
|
protected String |
localFileName
|
protected static org.apache.commons.logging.Log |
log
|
protected boolean |
major
|
protected int |
maxFragmentSize
|
protected FilePacketMonitor |
monitor
|
protected byte |
myFace
|
protected byte[] |
myFileSessionKey
|
protected byte[] |
myInternetIp
|
protected int |
myInternetPort
|
protected byte[] |
myLocalIp
|
protected int |
myMajorPort
|
protected int |
myMinorPort
|
protected int |
myQQ
|
protected Selector |
selector
|
protected char |
sessionSequence
|
protected boolean |
shutdown
|
protected boolean |
useUdp
|
protected SlideWindow |
window
|
Constructor Summary | |
---|---|
FileWatcher()
|
Method Summary | |
---|---|
abstract void |
abort()
abort file transfer 取消文件传输 |
void |
addFileListener(IFileListener listener)
add file transfer event listener 添加文件传输事件监听器 |
protected void |
checkCondition()
get both side's condition in network from IP condition 根据各方的IP情况,得到双方在网络上的处境 |
abstract void |
finish()
finish file transfer, process some post event 结束文件传输,处理一些善后事宜 |
protected void |
fireFileAbortedEvent()
fire file transfer aborted event 触发文件传输被取消事件 |
protected void |
fireFileConnectedEvent()
fire connected event 触发连接建立事件 |
protected void |
fireFileFinishedEvent()
fire file transfer finished event 触发文件传输完成事件 |
protected void |
fireFileInProgressEvent()
fire file transfer in progress event 触发文件传送中事件 |
int |
getCondition()
|
byte[] |
getFileAgentKey()
|
byte[] |
getFileAgentToken()
|
byte[] |
getFileMD5()
|
String |
getFileName()
|
byte[] |
getFileNameMD5()
|
int |
getFileSize()
|
int |
getFileTransferStatus()
|
int |
getFragments()
|
byte[] |
getHisFileSessionKey()
|
byte[] |
getHisInternetIp()
|
int |
getHisInternetPort()
|
byte[] |
getHisLocalIp()
|
int |
getHisMajorPort()
|
int |
getHisMinorPort()
|
int |
getHisQQ()
|
String |
getLocalFileName()
|
String |
getLocalFilePath()
|
int |
getMaxFragmentSize()
|
byte |
getMyFace()
|
byte[] |
getMyFileSessionKey()
|
byte[] |
getMyInternetIp()
|
int |
getMyInternetPort()
|
byte[] |
getMyLocalIp()
|
int |
getMyMajorPort()
|
int |
getMyMinorPort()
|
int |
getMyQQ()
|
char |
getSessionSequence()
|
SlideWindow |
getSlideWindow()
|
void |
initSlideWindow(int size,
int l,
int m)
init slide window 初始化滑窗 |
boolean |
isUseUdp()
|
abstract boolean |
openLocalFile()
opent local file to read and write 打开本地文件准备读和写 |
void |
removeFileListener(IFileListener listener)
remover file transfer event listener 移除文件传输事件监听器 |
void |
setCondition(int connectType)
|
void |
setFileAgentKey(byte[] fileAgentKey)
|
void |
setFileAgentToken(byte[] fileAgentToken)
|
void |
setFileMD5(byte[] firstMD5)
|
void |
setFileName(String fileName)
|
void |
setFileNameMD5(byte[] secondMD5)
|
void |
setFileSize(int fileSize)
|
void |
setFileTransferStatus(int fileTransferStatus)
|
void |
setFragments(int fragments)
|
void |
setHisFileSessionKey(byte[] hisFileSessionKey)
|
void |
setHisInternetIp(byte[] hisInternetIp)
|
void |
setHisInternetPort(int hisExternalPort)
|
void |
setHisLocalIp(byte[] hisLocalIp)
|
void |
setHisMajorPort(int hisFirstPort)
|
void |
setHisMinorPort(int hisSecondPort)
|
void |
setHisQQ(int hisQQ)
|
void |
setLocalFileName(String localFileName)
|
void |
setMaxFragmentSize(int maxFragmentSize)
|
void |
setMyFace(byte face)
|
void |
setMyFileSessionKey(byte[] myFileSessionKey)
|
void |
setMyInternetIp(byte[] myInternetIp)
|
void |
setMyInternetPort(int myExternalPort)
|
void |
setMyLocalIp(byte[] myLocalIp)
|
void |
setMyMajorPort(int myFirstPort)
|
void |
setMyMinorPort(int mySecondPort)
|
void |
setMyQQ(int myQQ)
|
void |
setSessionSequence(char sessionSequence)
|
abstract void |
shutdown()
close watcher 关闭守望者 |
abstract void |
start()
start watcher, for receiver, he will choose a link to transfer for sender, he will start two port waiting for reply by the other side 启动守望者,对于接收者,他将选择一条链路进行连接准备传输 对于发送者,他将启动两个端口等待对方应答 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FT_NONE
public static final int FT_NEGOTIATING
public static final int FT_SENDING
public static final int FT_RECEIVING
public static final int FT_SAYING_HELLO
public static final int FT_SENDING_EOF
public static final int FT_SENDING_BASIC
protected static org.apache.commons.logging.Log log
protected int myMajorPort
protected int myMinorPort
protected byte[] myLocalIp
protected byte[] myInternetIp
protected int myInternetPort
protected int hisMajorPort
protected int hisMinorPort
protected byte[] hisLocalIp
protected byte[] hisInternetIp
protected int hisInternetPort
protected byte[] myFileSessionKey
protected byte[] hisFileSessionKey
protected byte[] fileAgentKey
protected byte[] fileAgentToken
protected int hisQQ
protected int myQQ
protected byte myFace
protected char sessionSequence
protected int condition
protected int fileSize
protected String fileName
protected int fragments
protected String localFileName
protected RandomAccessFile localFile
protected SlideWindow window
protected int maxFragmentSize
protected byte[] fileMD5
protected byte[] fileNameMD5
protected FileDataPacket fdp
protected FileControlPacket fcp
protected Selector selector
protected boolean shutdown
protected ByteBuffer buffer
protected boolean useUdp
protected boolean major
protected int fileTransferStatus
protected FilePacketMonitor monitor
protected List<IFileListener> listeners
Constructor Detail |
---|
public FileWatcher()
udp
- 是否是udp方式 // whether is udp modeparent
- FileWatcher所属的发送消息窗口 // send message of FileWatcherme
- QQUser对象 // QQUser objectMethod Detail |
---|
public void initSlideWindow(int size, int l, int m)
size
- 窗口大小 window sizel
- 窗口初始下限 window initial lowm
- 窗口最大值 max of windowpublic void addFileListener(IFileListener listener)
listener
- public void removeFileListener(IFileListener listener)
listener
- protected void fireFileAbortedEvent()
protected void fireFileFinishedEvent()
protected void fireFileInProgressEvent()
protected void fireFileConnectedEvent()
protected void checkCondition()
public abstract void shutdown()
public abstract void abort()
public abstract void finish()
public abstract boolean openLocalFile()
public abstract void start()
start watcher, for receiver, he will choose a link to transfer for sender, he will start two port waiting for reply by the other side 启动守望者,对于接收者,他将选择一条链路进行连接准备传输 对于发送者,他将启动两个端口等待对方应答
public int getHisMajorPort()
public void setHisMajorPort(int hisFirstPort)
hisFirstPort
- The hisFirstPort to set.public int getHisMinorPort()
public void setHisMinorPort(int hisSecondPort)
hisSecondPort
- The hisSecondPort to set.public int getMyMajorPort()
public void setMyMajorPort(int myFirstPort)
myFirstPort
- The myFirstPort to set.public int getMyMinorPort()
public void setMyMinorPort(int mySecondPort)
mySecondPort
- The mySecondPort to set.public int getMyInternetPort()
public void setMyInternetPort(int myExternalPort)
myExternalPort
- The myExternalPort to set.public byte[] getHisFileSessionKey()
public void setHisFileSessionKey(byte[] hisFileSessionKey)
hisFileSessionKey
- The hisFileSessionKey to set.public int getHisQQ()
public void setHisQQ(int hisQQ)
hisQQ
- The hisQQ to set.public byte[] getMyFileSessionKey()
public void setMyFileSessionKey(byte[] myFileSessionKey)
myFileSessionKey
- The myFileSessionKey to set.public int getMyQQ()
public void setMyQQ(int myQQ)
myQQ
- The myQQ to set.public char getSessionSequence()
public void setSessionSequence(char sessionSequence)
sessionSequence
- The sessionSequence to set.public byte getMyFace()
public void setMyFace(byte face)
face
- The face to set.public byte[] getHisInternetIp()
public void setHisInternetIp(byte[] hisInternetIp)
hisInternetIp
- The hisExternalIp to set.public byte[] getHisLocalIp()
public void setHisLocalIp(byte[] hisLocalIp)
hisLocalIp
- The hisInternalIp to set.public byte[] getMyInternetIp()
public void setMyInternetIp(byte[] myInternetIp)
myInternetIp
- The myExternalIp to set.public byte[] getMyLocalIp()
public void setMyLocalIp(byte[] myLocalIp)
myLocalIp
- The myInternalIp to set.public int getHisInternetPort()
public void setHisInternetPort(int hisExternalPort)
hisExternalPort
- The hisExternalPort to set.public int getCondition()
public void setCondition(int connectType)
connectType
- The connectType to set.public String getFileName()
public void setFileName(String fileName)
fileName
- The fileName to set.public int getFileSize()
public void setFileSize(int fileSize)
fileSize
- The fileSize to set.public int getFragments()
public void setFragments(int fragments)
fragments
- The fragments to set.public String getLocalFileName()
public void setLocalFileName(String localFileName)
localFileName
- The localFileName to set.public int getMaxFragmentSize()
public void setMaxFragmentSize(int maxFragmentSize)
maxFragmentSize
- The maxFragmentSize to set.public byte[] getFileMD5()
public void setFileMD5(byte[] firstMD5)
firstMD5
- The firstMD5 to set.public byte[] getFileNameMD5()
public void setFileNameMD5(byte[] secondMD5)
secondMD5
- The secondMD5 to set.public int getFileTransferStatus()
public void setFileTransferStatus(int fileTransferStatus)
fileTransferStatus
- The fileTransferStatus to set.public String getLocalFilePath()
public SlideWindow getSlideWindow()
public boolean isUseUdp()
public byte[] getFileAgentKey()
public void setFileAgentKey(byte[] fileAgentKey)
fileAgentKey
- The fileAgentKey to set.public byte[] getFileAgentToken()
public void setFileAgentToken(byte[] fileAgentToken)
fileAgentToken
- The fileAgentToken to set.
|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |