public class FtpTransferControl extends Object
Constructor and Description |
---|
FtpTransferControl(FtpSession session) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the FtpTransferControl (called when the data connection must be over like from clear of
FtpDataAsyncConn ,
abort from ABOR or ending control connection from NetworkHandler . |
FtpTransfer |
getExecutingFtpTransfer() |
boolean |
isFtpTransferExecuting()
Is a command currently executing (called from
NetworkHandler when a message is
received to see if another transfer command is already in execution, which is not allowed) |
boolean |
openDataConnection()
Wait for the client to be connected (Passive) or Wait for the server to be connected to the
client (Active)
|
void |
resetWaitForOpenedDataChannel()
Allow to reset the waitForOpenedDataChannel
|
void |
setEndOfTransfer()
Set the current transfer as finished.
|
void |
setNewFtpTransfer(FtpCommandCode command,
FtpFile file)
Add a new transfer to be executed.
|
void |
setNewFtpTransfer(FtpCommandCode command,
List<String> list,
String path)
Add a new transfer to be executed.
|
void |
setOpenedDataChannel(io.netty.channel.Channel channel,
DataNetworkHandler dataNetworkHandler)
Set the new opened Channel (from channelConnected of
DataNetworkHandler ) |
void |
setPreEndOfTransfer()
Called by channelClosed (from
DataNetworkHandler ) or trueRetrieve
(from FtpFile ) when the transfer is over |
void |
setTransferAbortedFromInternal(boolean write)
To enable abort from internal error
|
void |
waitForDataNetworkHandlerReady()
Wait for the DataNetworkHandler to be ready (from trueRetrieve of
FtpFile ) |
void |
waitForEndOfTransfer()
Wait for the current transfer to finish, called from
FtpTransferExecutor |
io.netty.channel.Channel |
waitForOpenedDataChannel()
Wait that the new opened connection is ready (same method in
FtpDataAsyncConn from
openConnection) |
boolean |
waitFtpTransferExecuting() |
public FtpTransferControl(FtpSession session)
session
- public void waitForDataNetworkHandlerReady() throws InterruptedException
FtpFile
)InterruptedException
public void setOpenedDataChannel(io.netty.channel.Channel channel, DataNetworkHandler dataNetworkHandler)
DataNetworkHandler
)channel
- dataNetworkHandler
- public io.netty.channel.Channel waitForOpenedDataChannel() throws InterruptedException
FtpDataAsyncConn
from
openConnection)InterruptedException
public void resetWaitForOpenedDataChannel()
public boolean openDataConnection() throws org.waarp.common.command.exception.Reply425Exception
org.waarp.common.command.exception.Reply425Exception
public void setNewFtpTransfer(FtpCommandCode command, FtpFile file)
command
- file
- public void setNewFtpTransfer(FtpCommandCode command, List<String> list, String path)
command
- list
- path
- as Original Pathpublic boolean waitFtpTransferExecuting()
public boolean isFtpTransferExecuting()
NetworkHandler
when a message is
received to see if another transfer command is already in execution, which is not allowed)public FtpTransfer getExecutingFtpTransfer() throws FtpNoTransferException
FtpNoTransferException
public void setEndOfTransfer()
FtpTransferExecutor
when a transfer
is over.public void setTransferAbortedFromInternal(boolean write)
write
- True means the message is write back to the control command, false it is only
preparedpublic void setPreEndOfTransfer()
DataNetworkHandler
) or trueRetrieve
(from FtpFile
) when the transfer is overpublic void waitForEndOfTransfer() throws InterruptedException
FtpTransferExecutor
InterruptedException
public void clear()
FtpDataAsyncConn
,
abort from ABOR
or ending control connection from NetworkHandler
.Copyright © 2009–2019 Waarp. All rights reserved.