org.globus.ftp.dc
Class TransferThreadManager

java.lang.Object
  extended byorg.globus.ftp.dc.TransferThreadManager

public class TransferThreadManager
extends Object


Field Summary
protected  DataChannelFactory dataChannelFactory
           
protected  GridFTPServerFacade facade
           
protected  GridFTPSession gSession
           
protected  BasicServerControlChannel localControlChannel
           
protected  SocketPool socketPool
           
protected  TaskThread taskThread
           
protected  int transferThreadCount
           
 
Constructor Summary
TransferThreadManager(SocketPool socketPool, GridFTPServerFacade facade, BasicServerControlChannel myControlChannel, GridFTPSession gSession)
           
 
Method Summary
 void activeClose(TransferContext context, int connections)
          use only in mode E
 void activeConnect(HostPort hp, int connections)
          Act as the active side.
 void close()
           
 int getTransferThreadCount()
           
 void passiveConnect(DataSink sink, TransferContext context, int connections, ServerSocket serverSocket)
          Accept connections from the remote server, and start transfer threads that will read incoming data and store in the sink.
 void passiveConnect(DataSource source, TransferContext context, ServerSocket serverSocket)
          Accept connection from the remote server and start transfer thread that will read incoming data and store in the sink.
 void startTransfer(DataSink sink, TransferContext context, int connections, boolean reusable)
          This should be used once the remote active server connected to us.
 void startTransfer(DataSource source, TransferContext context, int connections, boolean reusable)
          This should be used once the remote active server connected to us.
 void stopTaskThread()
           
 void transferThreadStarting()
           
 void transferThreadTerminating()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socketPool

protected SocketPool socketPool

facade

protected GridFTPServerFacade facade

localControlChannel

protected BasicServerControlChannel localControlChannel

gSession

protected GridFTPSession gSession

taskThread

protected TaskThread taskThread

transferThreadCount

protected int transferThreadCount

dataChannelFactory

protected DataChannelFactory dataChannelFactory
Constructor Detail

TransferThreadManager

public TransferThreadManager(SocketPool socketPool,
                             GridFTPServerFacade facade,
                             BasicServerControlChannel myControlChannel,
                             GridFTPSession gSession)
Method Detail

activeConnect

public void activeConnect(HostPort hp,
                          int connections)
Act as the active side. Connect to the server and store the newly connected sockets in the socketPool.


activeClose

public void activeClose(TransferContext context,
                        int connections)
use only in mode E


startTransfer

public void startTransfer(DataSource source,
                          TransferContext context,
                          int connections,
                          boolean reusable)
                   throws ServerException
This should be used once the remote active server connected to us. This method starts transfer threads that will read data from the source and send.

Parameters:
reusable - if set to false, the sockets will not be reused after the transfer
Throws:
ServerException

startTransfer

public void startTransfer(DataSink sink,
                          TransferContext context,
                          int connections,
                          boolean reusable)
                   throws ServerException
This should be used once the remote active server connected to us. This method starts transfer threads that will receive the data and store them in the sink. Because of transfer direction, this method cannot be used with EBLOCK. Therefore the number of connections is fixed at 1.

Parameters:
reusable - if set to false, the sockets will not be reused after the transfer
Throws:
ServerException

passiveConnect

public void passiveConnect(DataSink sink,
                           TransferContext context,
                           int connections,
                           ServerSocket serverSocket)
                    throws ServerException
Accept connections from the remote server, and start transfer threads that will read incoming data and store in the sink.

Parameters:
connections - the number of expected connections
Throws:
ServerException

passiveConnect

public void passiveConnect(DataSource source,
                           TransferContext context,
                           ServerSocket serverSocket)
                    throws ServerException
Accept connection from the remote server and start transfer thread that will read incoming data and store in the sink. This method, because of direction of transfer, cannot be used with EBlock. Therefore it is fixed to create only 1 connection.

Throws:
ServerException

getTransferThreadCount

public int getTransferThreadCount()

transferThreadStarting

public void transferThreadStarting()

transferThreadTerminating

public void transferThreadTerminating()

stopTaskThread

public void stopTaskThread()

close

public void close()