net.grinder.plugin.http.tcpproxyfilter
Class HTTPResponseFilter

java.lang.Object
  extended by net.grinder.plugin.http.tcpproxyfilter.HTTPResponseFilter
All Implemented Interfaces:
TCPProxyFilter

public class HTTPResponseFilter
extends Object
implements TCPProxyFilter

TCPProxyFilter that collects data from server responses. Should be installed as a response filter. Used by HttpPluginTCPProxyFilter to determine things such as the basic authentication realm.

Author:
Philip Aston, Bertrand Ave

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.grinder.tools.tcpproxy.TCPProxyFilter
TCPProxyFilter.FilterException
 
Constructor Summary
HTTPResponseFilter(HTTPFilterEventListener eventListener)
          Constructor.
 
Method Summary
 void connectionClosed(ConnectionDetails connectionDetails)
          A connection has been closed.
 void connectionOpened(ConnectionDetails connectionDetails)
          A new connection has been opened.
 byte[] handle(ConnectionDetails connectionDetails, byte[] buffer, int bytesRead)
          Handle a message fragment from the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPResponseFilter

public HTTPResponseFilter(HTTPFilterEventListener eventListener)
Constructor.

Parameters:
eventListener - Connection handler.
Method Detail

handle

public byte[] handle(ConnectionDetails connectionDetails,
                     byte[] buffer,
                     int bytesRead)
              throws TCPProxyFilter.FilterException
Handle a message fragment from the stream.

This is called for message fragments, don't assume that its passed a complete HTTP message at a time.

Specified by:
handle in interface TCPProxyFilter
Parameters:
connectionDetails - Describes the connection.
buffer - Contains the data.
bytesRead - How many bytes of data in buffer.
Returns:
Filters can optionally return a byte[] which will be transmitted to the server instead of buffer.
Throws:
TCPProxyFilter.FilterException - If an error occurs.

connectionOpened

public void connectionOpened(ConnectionDetails connectionDetails)
A new connection has been opened.

Specified by:
connectionOpened in interface TCPProxyFilter
Parameters:
connectionDetails - Describes the connection.

connectionClosed

public void connectionClosed(ConnectionDetails connectionDetails)
A connection has been closed.

Specified by:
connectionClosed in interface TCPProxyFilter
Parameters:
connectionDetails - Describes the connection.


Copyright © 2000-2013. All Rights Reserved.