Package org.globus.ftp.dc

# Class SimpleDataChannel

java.lang.Object
org.globus.ftp.dc.AbstractDataChannel
org.globus.ftp.dc.SimpleDataChannel

All Implemented Interfaces:
  `DataChannel`

Direct Known Subclasses:
  `GridFTPDataChannel`

public class SimpleDataChannel extends AbstractDataChannel
Data channel receives in the constructor a socket that should be ready for communication, and starts a new thread that will perform the transfer.
In previous version, the data channel would perform socket initialization (server.accept() etc.). This is now done by the facade's manager thread, so it can start several data channels.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static org.apache.commons.logging.Log`
`logger`
`protected SocketBox`
`socketBox`
`protected TransferThread`
`transferThread`
`protected TransferThreadFactory`
`transferThreadFactory`

### Fields inherited from class org.globus.ftp.dc.AbstractDataChannel

`dataHandlers, session`

## Constructor Summary

Constructors
Constructor
Description
`SimpleDataChannel(Session session, SocketBox socketBox)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`startTransfer(DataSink sink, BasicServerControlChannel localControlChannel, TransferContext context)`
`void`
`startTransfer(DataSource source, BasicServerControlChannel localControlChannel, TransferContext context)`

### Methods inherited from class org.globus.ftp.dc.AbstractDataChannel

`getDataChannelSink, getDataChannelSource, isDataSinkModeSupported, isDataSourceModeSupported, registerHandler`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### logger

protected static org.apache.commons.logging.Log logger

### socketBox

protected SocketBox socketBox

### transferThread

protected TransferThread transferThread

### transferThreadFactory

protected TransferThreadFactory transferThreadFactory

## Constructor Details

### SimpleDataChannel

public SimpleDataChannel(Session session, SocketBox socketBox)

Parameters:
  `socketBox` - should be opened and ready for comunication

## Method Details

### close

public void close() throws IOException

Throws:
  `IOException`

### startTransfer

public void startTransfer(DataSink sink, BasicServerControlChannel localControlChannel, TransferContext context) throws Exception

Throws:
  `Exception`

### startTransfer

public void startTransfer(DataSource source, BasicServerControlChannel localControlChannel, TransferContext context) throws Exception

Throws:
  `Exception`