com.joctopus.work
Class FileTransferService

java.lang.Object
  extended by java.lang.Thread
      extended by com.joctopus.work.FileTransferService
All Implemented Interfaces:
java.lang.Runnable

public class FileTransferService
extends java.lang.Thread

Represents the single thread in pool of threads, this class services the file to client.

Since:
1.0

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileTransferService(java.lang.Integer ID, JOctopusConsole chatterConsole, FileTransferServer fserver, java.nio.channels.SocketChannel socketChannel)
           
 
Method Summary
 JOctopusConsole getChatterConsole()
           
 java.lang.String getFilePath()
           
 java.lang.String getHeader()
           
 java.lang.Integer getID()
           
 java.lang.StringBuffer getMessage()
           
 int getPort()
           
 java.nio.channels.SocketChannel getSocketChannel()
           
 void run()
           
 void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
           
 
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
 

Constructor Detail

FileTransferService

public FileTransferService(java.lang.Integer ID,
                           JOctopusConsole chatterConsole,
                           FileTransferServer fserver,
                           java.nio.channels.SocketChannel socketChannel)
Parameters:
ID - which represents the index of this thread in pool, it uniquely identifies the thread so that this thread can be disposed after servicing client.
chatterConsole - window.
socketChannel -
fserver - is FileTransferServer Object
Method Detail

getSocketChannel

public java.nio.channels.SocketChannel getSocketChannel()
Returns:
socketChannel assigned to this service.

setSocketChannel

public void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
Parameters:
socketChannel - set the SocketChannel, to which this thread will service.

getID

public java.lang.Integer getID()
Returns:
index or ID in pool of thread for uniquely identifying and locating this thread in pool of threads maintained by FileTransferServer.

getFilePath

public java.lang.String getFilePath()
Returns:
The file path, the file requested by reciever.

getHeader

public java.lang.String getHeader()
Returns:

getMessage

public java.lang.StringBuffer getMessage()
Returns:
the message sent by reciever.

getPort

public int getPort()
Returns:
The port at which recievers socketChannel is bind at remote machine.

getChatterConsole

public JOctopusConsole getChatterConsole()
Returns:
chatter console for writing debug output.

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread