|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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 All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |