|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.globus.ftp.vanilla.FTPServerFacade
This class is not ment directly for the users.
This class represents the part of the client responsible for data
channel management. Especially when the remote server is in the passive
mode, it behaves a lot like a local server. Thus its interface looks
very much like a server interface.
Current implementation is multithreaded. One thread is used for thread
management and one for each transfer (this makes sense in GridFTP
parallelism).
The public methods can generally be divided into setter methods and active
methods. Active methods are setActive(), setPassive(), retrieve(),
and store(), and setter methods are the remaining.
Setter methods do not generally throw exceptions related to ftp.
Settings are not checked for correctness until the server
is asked to performed some action, which is done by active methods.
So you are safe to cal setXX() methods with any argument you like, until
you call one of the "active" methods mentioned above.
The managing thread is not started until one of the "active" methods is
called: setActive(), retrieve(), or store(). These methods
are asynchronous (return before completion) and the action is undertaken
by the local manager thread. From this point on, all communication
back to the caller is done through unidirectional local control
channel. Information is communicated back to the user in form of FTP
replies (instances of LocalReply). Generally, the sequence of
replies should be the same as when communicating with remote server
during the transfer (1xx intermediary reply; markers; final 226).
Exceptions are serialized into 451 negative reply.
Nested Class Summary | |
protected class |
FTPServerFacade.LocalControlChannel
This inner class represents a local control channel. |
Field Summary | |
static int |
ANY_PORT
local server socket parameter; used in setPassive() |
protected DataChannelFactory |
dataChannelFactory
|
static int |
DEFAULT_QUEUE
local server socket parameter; used in setPassive() |
protected FTPServerFacade.LocalControlChannel |
localControlChannel
|
protected FTPControlChannel |
remoteControlChannel
|
protected HostPort |
remoteServerAddress
|
protected ServerSocket |
serverSocket
|
protected Session |
session
|
Constructor Summary | |
FTPServerFacade(FTPControlChannel remoteControlChannel)
|
Method Summary | |
void |
abort()
close data channels, but not control, nor the server |
void |
authorize()
No need for parameters; locally you are always authorized. |
static void |
cannotPropagateError(Throwable e)
Data channels are operated in multithreaded manner and they pass information (including exceptions) to the user using the local control channel. |
void |
close()
|
protected TransferContext |
createTransferContext()
|
protected void |
exceptionToControlChannel(Throwable e,
String msg)
Convert the exception to a negative 451 reply, and pipe it to the control channel. |
static void |
exceptionToControlChannel(Throwable e,
String msg,
BasicServerControlChannel control)
Convert the exception to a negative 451 reply, and pipe it to the provided control channel. |
BasicClientControlChannel |
getControlChannel()
Use this method to get the client end of the local control channel. |
Session |
getSession()
|
void |
retrieve(DataSource source)
Asynchronous; return before completion. |
void |
setActive(HostPort hp)
Asynchronous; return before completion. |
void |
setOptions(Options opts)
Do nothing; this class does not support any options |
HostPort |
setPassive()
Behave like setPassive(ANY_PORT, DEFAULT_QUEUE) |
HostPort |
setPassive(int port,
int queue)
Start the local server |
void |
setProtectionBufferSize(int size)
|
void |
setTransferMode(int mode)
|
void |
setTransferType(int type)
|
protected void |
stopTaskThread()
|
void |
store(DataSink sink)
Asynchronous; return before completion. |
protected void |
transferAbort()
|
protected void |
unblockServer()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ANY_PORT
public static final int DEFAULT_QUEUE
protected Session session
protected FTPServerFacade.LocalControlChannel localControlChannel
protected DataChannelFactory dataChannelFactory
protected ServerSocket serverSocket
protected FTPControlChannel remoteControlChannel
protected HostPort remoteServerAddress
Constructor Detail |
public FTPServerFacade(FTPControlChannel remoteControlChannel)
Method Detail |
public static void cannotPropagateError(Throwable e)
public BasicClientControlChannel getControlChannel()
public Session getSession()
public void authorize()
public void setTransferType(int type)
public void setTransferMode(int mode)
public void setProtectionBufferSize(int size)
public void setOptions(Options opts)
public HostPort setPassive() throws IOException
IOException
public HostPort setPassive(int port, int queue) throws IOException
port
- required server port; can be set to ANY_PORTqueue
- max size of queue of awaiting new connection
requests
IOException
public void setActive(HostPort hp) throws UnknownHostException, ClientException, IOException
UnknownHostException
ClientException
IOException
protected void exceptionToControlChannel(Throwable e, String msg)
public static void exceptionToControlChannel(Throwable e, String msg, BasicServerControlChannel control)
public void store(DataSink sink)
public void retrieve(DataSource source)
public void abort() throws IOException
IOException
protected void transferAbort()
protected void unblockServer()
public void close() throws IOException
IOException
protected void stopTaskThread()
protected TransferContext createTransferContext()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |