ch.mimo.netty.handler.codec.icap
Class IcapChunkAggregator

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by ch.mimo.netty.handler.codec.icap.IcapChunkAggregator
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public class IcapChunkAggregator
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler

This ICAP chunk aggregator will combine an received ICAP message with all body chunks. the body is the to be found attached to the correct HTTP request or response instance within the ICAP message.

Author:
Michael Mimo Moratti (mimo@mimo.ch)
See Also:
IcapChunkSeparator

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
IcapChunkAggregator(long maxContentLength)
           
 
Method Summary
static org.jboss.netty.buffer.ChannelBuffer extractHttpBodyContentFromIcapMessage(IcapMessage message)
          Convenience method to retrieve a HTTP request,response or an ICAP options response body from an aggregated IcapMessage.
 void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e)
           
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, exceptionCaught, handleUpstream, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IcapChunkAggregator

public IcapChunkAggregator(long maxContentLength)
Parameters:
maxContentLength - defines the maximum length of the body content that is allowed. If the length is exceeded an exception is thrown.
Method Detail

extractHttpBodyContentFromIcapMessage

public static org.jboss.netty.buffer.ChannelBuffer extractHttpBodyContentFromIcapMessage(IcapMessage message)
Convenience method to retrieve a HTTP request,response or an ICAP options response body from an aggregated IcapMessage.

Parameters:
message -
Returns:
null or @see ChannelBuffer if a body exists.

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.SimpleChannelUpstreamHandler
Throws:
Exception


Copyright © 2011. All Rights Reserved.