rabbit.handler
Class FilterHandler
java.lang.Object
rabbit.handler.BaseHandler
rabbit.handler.GZipHandler
rabbit.handler.FilterHandler
- All Implemented Interfaces:
- BlockListener, Handler, HandlerFactory, AsyncListener, BlockSentListener, HttpHeaderSentListener
public class FilterHandler
- extends GZipHandler
This handler filters out unwanted html features.
- Author:
- Robert Olofsson
Fields inherited from class rabbit.handler.BaseHandler |
cacheChannel, clientBuffer, con, content, entry, mayCache, mayFilter, request, response, size, tlh, totalRead |
Constructor Summary |
FilterHandler()
|
FilterHandler(Connection con,
TrafficLoggerHandler tlh,
HttpHeader request,
ByteBuffer clientBuffer,
HttpHeader response,
ResourceSource content,
boolean mayCache,
boolean mayFilter,
long size,
boolean compress,
List<HtmlFilterFactory> filterClasses)
Create a new FilterHandler for the given request. |
Methods inherited from class rabbit.handler.BaseHandler |
addCache, failed, finish, finishedRead, getLogger, handle, httpHeaderSent, mayCacheFromSize, mayRestrictCacheSize, prepareStream, removeCache, send, sendHeader, setPartialContent, timeout, writeCache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilterHandler
public FilterHandler()
FilterHandler
public FilterHandler(Connection con,
TrafficLoggerHandler tlh,
HttpHeader request,
ByteBuffer clientBuffer,
HttpHeader response,
ResourceSource content,
boolean mayCache,
boolean mayFilter,
long size,
boolean compress,
List<HtmlFilterFactory> filterClasses)
- Create a new FilterHandler for the given request.
- Parameters:
con
- the Connection handling the request.request
- the actual request made.clientBuffer
- the client side buffer.response
- the actual response.content
- the resource.mayCache
- May we cache this request?mayFilter
- May we filter this request?size
- the size of the data beeing handled.compress
- if we want this handler to compress or not.
getNewInstance
public Handler getNewInstance(Connection con,
TrafficLoggerHandler tlh,
HttpHeader header,
ByteBuffer buffer,
HttpHeader webHeader,
ResourceSource content,
boolean mayCache,
boolean mayFilter,
long size)
- Description copied from interface:
HandlerFactory
- Get a new Handler for the given request made.
- Specified by:
getNewInstance
in interface HandlerFactory
- Overrides:
getNewInstance
in class GZipHandler
- Parameters:
con
- the Connection handling the request.tlh
- the Traffic logger handler.header
- the request.buffer
- the client side buffer (may contain the next request).webHeader
- the response.content
- the resource.mayCache
- if the handler may cache the response.mayFilter
- if the handler may filter the response.size
- the Size of the data beeing handled (-1 = unknown length).
writeDataToGZipper
protected void writeDataToGZipper(byte[] arr)
throws IOException
- Description copied from class:
GZipHandler
- Write the current block of data to the gzipper.
If you override this method you probably want to override
the modifyBuffer(ByteBuffer) as well.
- Overrides:
writeDataToGZipper
in class GZipHandler
- Parameters:
arr
- the data to write to the gzip stream.
- Throws:
IOException
modifyBuffer
protected void modifyBuffer(ByteBuffer buf)
- Description copied from class:
GZipHandler
- This method is used when we are not compressing data.
This method will just call "super.bufferRead (buf);"
- Overrides:
modifyBuffer
in class GZipHandler
- Parameters:
buf
- the buffer that was just read.
finishData
protected void finishData()
throws IOException
- Description copied from class:
BaseHandler
- This method is used to finish the data for the resource being sent.
This method does nothing here.
- Overrides:
finishData
in class GZipHandler
- Throws:
IOException
setup
public void setup(Logger logger,
SProperties prop)
- Setup this class.
- Specified by:
setup
in interface HandlerFactory
- Overrides:
setup
in class GZipHandler
- Parameters:
prop
- the properties of this class.