net.grinder.tools.tcpproxy
Class CompositeFilter

java.lang.Object
  extended by net.grinder.tools.tcpproxy.CompositeFilter
All Implemented Interfaces:
TCPProxyFilter

public final class CompositeFilter
extends Object
implements TCPProxyFilter

Composite TCPProxyFilter.

Author:
Philip Aston

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

Constructor Detail

CompositeFilter

public CompositeFilter()
Method Detail

handle

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

Specified by:
handle in interface TCPProxyFilter
Parameters:
connectionDetails - Describes the connection.
originalBuffer - 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)
                      throws TCPProxyFilter.FilterException
A new connection has been opened.

Specified by:
connectionOpened in interface TCPProxyFilter
Parameters:
connectionDetails - Describes the connection.
Throws:
TCPProxyFilter.FilterException - If an error occurs.

connectionClosed

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

Specified by:
connectionClosed in interface TCPProxyFilter
Parameters:
connectionDetails - Describes the connection.
Throws:
TCPProxyFilter.FilterException - If an error occurs.

add

public void add(TCPProxyFilter filter)
Add a filter to the composite.

Parameters:
filter - The filter.

toString

public String toString()
Describe the filter.

Overrides:
toString in class Object
Returns:
The description.


Copyright © 2000-2013. All Rights Reserved.