public class DataNetworkHandler extends io.netty.channel.SimpleChannelInboundHandler<DataBlock>
Modifier and Type | Field and Description |
---|---|
protected FtpConfiguration |
configuration
Configuration
|
protected FtpSession |
session
Internal store for the SessionInterface
|
Constructor and Description |
---|
DataNetworkHandler(FtpConfiguration configuration,
DataBusinessHandler handler,
boolean active)
Constructor from DataBusinessHandler
|
Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx)
Initialize the Handler.
|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
Run firstly executeChannelClosed.
|
void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
DataBlock dataBlock)
Act as needed according to the receive DataBlock message
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
Default exception task: close the current connection after calling
exceptionLocalCaught.
|
DataBusinessHandler |
getDataBusinessHandler() |
FtpSession |
getFtpSession() |
NetworkHandler |
getNetworkHandler() |
void |
setCorrectCodec()
Set the CODEC according to the mode.
|
void |
setFtpTransfer(FtpTransfer ftpTransfer) |
protected void |
setSession(io.netty.channel.Channel channel) |
void |
unlockModeCodec()
Unlock the Mode Codec from openConnection of
FtpTransferControl |
boolean |
writeMessage(String message)
Write a simple message (like LIST) and wait for it
|
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
protected final FtpConfiguration configuration
protected FtpSession session
public DataNetworkHandler(FtpConfiguration configuration, DataBusinessHandler handler, boolean active)
configuration
- handler
- active
- public DataBusinessHandler getDataBusinessHandler() throws FtpNoConnectionException
FtpNoConnectionException
public final FtpSession getFtpSession()
public final NetworkHandler getNetworkHandler()
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
protected final void setSession(io.netty.channel.Channel channel)
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
public final void setCorrectCodec() throws FtpNoConnectionException
FtpNoConnectionException
public final void unlockModeCodec()
FtpTransferControl
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
public final void setFtpTransfer(FtpTransfer ftpTransfer)
public void channelRead0(io.netty.channel.ChannelHandlerContext ctx, DataBlock dataBlock)
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler<DataBlock>
public final boolean writeMessage(String message)
message
- Copyright © 2009–2022 Waarp. All rights reserved.