|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
common.StoppableThread
common.TransfertSlave
common.ThreadStopper
server.core.TransfertHandler
public class TransfertHandler
Gère un transfert.
Initialise le transfert avec le client en échangeant avec le client les caractéristiques du fichier à transférer.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private TCPConnection |
clientConnection
Gestionnaire de la connexion avec le client. |
private FileOutput |
fileWriter
Gestionnaire de l'écriture des offsets reçus. |
Hashtable<Long,byte[]> |
receivedOffsets
Table des offsets reçus. |
private ServerScheduler |
scheduler
Ordonnanceur du serveur. |
private static long |
TIME_WAITING_TRANSFERING
Temps d'attente de la fin du transfert par le gestionnaire. |
byte |
transfertID
ID de ce transfert. |
| Fields inherited from class common.TransfertSlave |
|---|
master |
| Fields inherited from class common.StoppableThread |
|---|
quitQuery |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
TransfertHandler(TransfertMaster master,
ServerScheduler scheduler,
byte transfertID,
Socket tcpConnection)
Initialise un nouveau transfert avec la nouvelle connexion TCP reçue. |
|
| Method Summary | |
|---|---|
protected void |
doFree()
Prends les dispositions pour libérer les ressources utilisées dans cette classe. |
void |
doQuit()
Prends les dispositions pour que le thread termine et sorte seul de sa méthode run(). |
TCPConnection |
getClientConnection()
Accède au gestionnaire de connexion avec le client. |
FileOutput |
getFileWriter()
Accède au gestionnaire du fichier. |
File |
getIncomingDir()
Donne le dossier où stocker les fichiers reçus. |
void |
run()
|
| Methods inherited from class common.ThreadStopper |
|---|
quitThreadAndWait |
| Methods inherited from class common.StoppableThread |
|---|
free, quit |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long TIME_WAITING_TRANSFERING
public final Hashtable<Long,byte[]> receivedOffsets
UDPListener et supprimés lors de l'écriture par
FileOutput.
public final byte transfertID
private final ServerScheduler scheduler
private FileOutput fileWriter
private TCPConnection clientConnection
| Constructor Detail |
|---|
public TransfertHandler(TransfertMaster master,
ServerScheduler scheduler,
byte transfertID,
Socket tcpConnection)
master - objet maître.transfertID - ID du transfert.tcpConnection - connexion TCP attribuée à ce transfert.| Method Detail |
|---|
public FileOutput getFileWriter()
public TCPConnection getClientConnection()
protected void doFree()
StoppableThread
doFree in class StoppableThreadThread.run(),
StoppableThread.isFree,
StoppableThread.free()public void doQuit()
StoppableThread
doQuit in class StoppableThreadThread.run(),
StoppableThread.quitQuery,
StoppableThread.quit()public void run()
run in interface Runnablerun in class Threadpublic File getIncomingDir()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||