com.joctopus.server
Class FileTransferServer

java.lang.Object
  extended by java.lang.Thread
      extended by com.joctopus.server.Server
          extended by com.joctopus.server.FileTransferServer
All Implemented Interfaces:
java.lang.Runnable

public class FileTransferServer
extends Server

This class is a file transfer server, that sends file to client on recieving specific message that describes the location of file on desktop where this server is running. The message format is \n here, file-path is full path of file. All values are mandatory.

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 com.joctopus.server.Server
debug
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileTransferServer(int port, JOctopusConsole chatterConsole, int poolSize)
           
FileTransferServer(JOctopusConsole chatterConsole, int poolSize)
           
 
Method Summary
 java.util.Vector getBusyPools()
           
 void removeID(java.lang.Integer ID)
          removes the ID from the busy pools.
 void run()
           
 void startServer()
          starts server.
 
Methods inherited from class com.joctopus.server.Server
addMessageRecieveListener, getChatServerSocket, getChatterConsole, getMessageRecieveListener, getPort, getRecievedClientSocket, getRecievedClientSocketChannel, getServerName, getServerSocketChannel, instantiateServer, isFailToRun, isStarted, setPort, setRecievedClientSocket, setServerName, stopService, writeOut
 
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

FileTransferServer

public FileTransferServer(int port,
                          JOctopusConsole chatterConsole,
                          int poolSize)
Parameters:
port - at which the service will start and listen for client notification.
chatterConsole - is a console window
poolSize - can be logically thought as maximum no of active client requests that can be handled by server.

FileTransferServer

public FileTransferServer(JOctopusConsole chatterConsole,
                          int poolSize)
Parameters:
chatterConsole - JOctopusConsole object for writing debug output
poolSize - size of pool
Method Detail

startServer

public void startServer()
                 throws java.net.BindException
Description copied from class: Server
starts server.

Overrides:
startServer in class Server
Throws:
java.net.BindException

run

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

getBusyPools

public java.util.Vector getBusyPools()
Returns:
busy pools

removeID

public void removeID(java.lang.Integer ID)
removes the ID from the busy pools. To allow only one service thread to access this method at a time it is synchronized

Parameters:
ID - the ID to be removed from busy pools.