org.littleshoot.proxy
Class ProxyHttpRequestEncoder

java.lang.Object
  extended by org.jboss.netty.handler.codec.oneone.OneToOneEncoder
      extended by org.jboss.netty.handler.codec.http.HttpMessageEncoder
          extended by org.jboss.netty.handler.codec.http.HttpRequestEncoder
              extended by org.littleshoot.proxy.ProxyHttpRequestEncoder
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler

public class ProxyHttpRequestEncoder
extends org.jboss.netty.handler.codec.http.HttpRequestEncoder

Request encoder for the proxy. This is necessary because we need to have access to the most recent request message on this connection to determine caching rules.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
ProxyHttpRequestEncoder(HttpRelayingHandler handler)
          Creates a new request encoder.
ProxyHttpRequestEncoder(HttpRelayingHandler handler, HttpRequestFilter requestFilter, boolean keepProxyFormat)
          Creates a new request encoder.
 
Method Summary
protected  Object encode(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.Channel channel, Object msg)
           
 
Methods inherited from class org.jboss.netty.handler.codec.http.HttpRequestEncoder
encodeInitialLine
 
Methods inherited from class org.jboss.netty.handler.codec.oneone.OneToOneEncoder
doEncode, handleDownstream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyHttpRequestEncoder

public ProxyHttpRequestEncoder(HttpRelayingHandler handler)
Creates a new request encoder.

Parameters:
handler - The class that handles relaying all data along this connection. We need this to synchronize caching rules for each request and response pair.

ProxyHttpRequestEncoder

public ProxyHttpRequestEncoder(HttpRelayingHandler handler,
                               HttpRequestFilter requestFilter,
                               boolean keepProxyFormat)
Creates a new request encoder.

Parameters:
handler - The class that handles relaying all data along this connection. We need this to synchronize caching rules for each request and response pair.
requestFilter - The filter for requests.
keepProxyFormat - keep proxy-formatted URI (used in chaining)
Method Detail

encode

protected Object encode(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.Channel channel,
                        Object msg)
                 throws Exception
Overrides:
encode in class org.jboss.netty.handler.codec.http.HttpMessageEncoder
Throws:
Exception


Copyright © 2009-2013 LittleShoot. All Rights Reserved.