org.littleshoot.proxy
Class HttpFiltersAdapter

java.lang.Object
  extended by org.littleshoot.proxy.HttpFiltersAdapter
All Implemented Interfaces:
HttpFilters

public class HttpFiltersAdapter
extends Object
implements HttpFilters

Convenience base class for implementations of HttpFilters.


Field Summary
protected  io.netty.channel.ChannelHandlerContext ctx
           
protected  io.netty.handler.codec.http.HttpRequest originalRequest
           
 
Constructor Summary
HttpFiltersAdapter(io.netty.handler.codec.http.HttpRequest originalRequest)
           
HttpFiltersAdapter(io.netty.handler.codec.http.HttpRequest originalRequest, io.netty.channel.ChannelHandlerContext ctx)
           
 
Method Summary
 io.netty.handler.codec.http.HttpResponse requestPost(io.netty.handler.codec.http.HttpObject httpObject)
          Filters requests on their way from the proxy to the server.
 io.netty.handler.codec.http.HttpResponse requestPre(io.netty.handler.codec.http.HttpObject httpObject)
          Filters requests on their way from the client to the proxy.
 io.netty.handler.codec.http.HttpObject responsePost(io.netty.handler.codec.http.HttpObject httpObject)
          Filters responses on their way from the proxy to the client.
 io.netty.handler.codec.http.HttpObject responsePre(io.netty.handler.codec.http.HttpObject httpObject)
          Filters responses on their way from the server to the proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

originalRequest

protected final io.netty.handler.codec.http.HttpRequest originalRequest

ctx

protected final io.netty.channel.ChannelHandlerContext ctx
Constructor Detail

HttpFiltersAdapter

public HttpFiltersAdapter(io.netty.handler.codec.http.HttpRequest originalRequest,
                          io.netty.channel.ChannelHandlerContext ctx)

HttpFiltersAdapter

public HttpFiltersAdapter(io.netty.handler.codec.http.HttpRequest originalRequest)
Method Detail

requestPre

public io.netty.handler.codec.http.HttpResponse requestPre(io.netty.handler.codec.http.HttpObject httpObject)
Description copied from interface: HttpFilters
Filters requests on their way from the client to the proxy.

Specified by:
requestPre in interface HttpFilters
Returns:
if you want to interrupted processing and return a response to the client, return it here, otherwise return null to continue processing as usual

requestPost

public io.netty.handler.codec.http.HttpResponse requestPost(io.netty.handler.codec.http.HttpObject httpObject)
Description copied from interface: HttpFilters
Filters requests on their way from the proxy to the server.

Specified by:
requestPost in interface HttpFilters
Returns:
if you want to interrupted processing and return a response to the client, return it here, otherwise return null to continue processing as usual

responsePre

public io.netty.handler.codec.http.HttpObject responsePre(io.netty.handler.codec.http.HttpObject httpObject)
Description copied from interface: HttpFilters
Filters responses on their way from the server to the proxy.

Specified by:
responsePre in interface HttpFilters
Returns:
the modified (or unmodified) HttpObject. Returning null will force a disconnect.

responsePost

public io.netty.handler.codec.http.HttpObject responsePost(io.netty.handler.codec.http.HttpObject httpObject)
Description copied from interface: HttpFilters
Filters responses on their way from the proxy to the client.

Specified by:
responsePost in interface HttpFilters
Returns:
the modified (or unmodified) HttpObject. Returning null will force a disconnect.


Copyright © 2009-2014 LittleShoot. All Rights Reserved.