org.neociclo.odetteftp.netty
Class OdetteFtpChannelHandler

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelHandler
      extended by org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler
          extended by org.neociclo.odetteftp.netty.OdetteFtpChannelHandler
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

@ChannelHandler.Sharable
public class OdetteFtpChannelHandler
extends org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler

The Timer which was specified when the ReadTimeoutHandler is created should be stopped manually by calling #releaseExternalResources() or Timer.stop() when your application shuts down.

Version:
$Rev: 587 $ $Date: 2010-08-12 18:17:42 -0300 (Thu, 12 Aug 2010) $
Author:
Rafael Marins

Nested Class Summary
static class OdetteFtpChannelHandler.ChannelCallbackHandler
          Implement interface to provide in OdetteFtpSession to allow writing messages in the communication channel.
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
OdetteFtpChannelHandler(EntityType entityType, OftpletFactory oftpletFactory, org.jboss.netty.util.Timer timer, org.jboss.netty.channel.group.ChannelGroup channelGroup)
          Let create the handler using ODETTE FTP entity type (Initiator or Responder) and protocol version of your choice.
OdetteFtpChannelHandler(OftpletFactory oftpletFactory, org.jboss.netty.util.Timer timer, org.jboss.netty.channel.group.ChannelGroup channelGroup)
          Default constructor.
 
Method Summary
 void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
           
 void channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
           
 void channelIdle(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.handler.timeout.IdleStateEvent e)
          This method is called whenever the communication data flow is idle and the session timeout limit is over.
 void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
           
 void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e)
           
 OftpletFactory getOftpletFactory()
           
 void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e)
           
 void writeRequested(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e)
           
 
Methods inherited from class org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler
handleUpstream
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelHandler
bindRequested, channelBound, channelClosed, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, handleDownstream, setInterestOpsRequested, unbindRequested, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OdetteFtpChannelHandler

public OdetteFtpChannelHandler(OftpletFactory oftpletFactory,
                               org.jboss.netty.util.Timer timer,
                               org.jboss.netty.channel.group.ChannelGroup channelGroup)
Default constructor. Handler creates ODETTE FTP entity starting using default entity type and version values.

Parameters:
channelGroup -
See Also:
OdetteFtpConstants.DEFAULT_OFTP_ENTITY_TYPE, OdetteFtpConstants.DEFAULT_OFTP_VERSION

OdetteFtpChannelHandler

public OdetteFtpChannelHandler(EntityType entityType,
                               OftpletFactory oftpletFactory,
                               org.jboss.netty.util.Timer timer,
                               org.jboss.netty.channel.group.ChannelGroup channelGroup)
Let create the handler using ODETTE FTP entity type (Initiator or Responder) and protocol version of your choice.

Parameters:
entityType -
channelGroup -
version -
Method Detail

channelOpen

public void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.ChannelStateEvent e)
                 throws Exception
Overrides:
channelOpen in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception

channelConnected

public void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
                             org.jboss.netty.channel.ChannelStateEvent e)
                      throws Exception
Overrides:
channelConnected in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception

messageReceived

public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
                            org.jboss.netty.channel.MessageEvent e)
                     throws Exception
Overrides:
messageReceived in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception

writeRequested

public void writeRequested(org.jboss.netty.channel.ChannelHandlerContext ctx,
                           org.jboss.netty.channel.MessageEvent e)
                    throws Exception
Overrides:
writeRequested in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception

channelIdle

public void channelIdle(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.handler.timeout.IdleStateEvent e)
                 throws Exception
This method is called whenever the communication data flow is idle and the session timeout limit is over.

Overrides:
channelIdle in class org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler
Throws:
Exception

channelDisconnected

public void channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
                                org.jboss.netty.channel.ChannelStateEvent e)
                         throws Exception
Overrides:
channelDisconnected in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception

getOftpletFactory

public OftpletFactory getOftpletFactory()

exceptionCaught

public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
                            org.jboss.netty.channel.ExceptionEvent e)
                     throws Exception
Overrides:
exceptionCaught in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception


ACCORD