public class DataNetworkHandler
extends io.netty.channel.SimpleChannelInboundHandler<org.waarp.common.file.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,
org.waarp.common.file.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 FtpSession getFtpSession()
public 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 void setSession(io.netty.channel.Channel channel)
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void setCorrectCodec()
public void unlockModeCodec()
FtpTransferControl
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void setFtpTransfer(FtpTransfer ftpTransfer)
public void channelRead0(io.netty.channel.ChannelHandlerContext ctx, org.waarp.common.file.DataBlock dataBlock)
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler<org.waarp.common.file.DataBlock>
public boolean writeMessage(String message)
message
- Copyright © 2009–2019 Waarp. All rights reserved.