net.sf.j2ep.responsehandlers
Class TraceResponseHandler

java.lang.Object
  extended by net.sf.j2ep.responsehandlers.ResponseHandlerBase
      extended by net.sf.j2ep.responsehandlers.TraceResponseHandler
All Implemented Interfaces:
ResponseHandler

public class TraceResponseHandler
extends ResponseHandlerBase

A handler for the TRACE method. This handler will make a check if the trace is directed to the proxy or a underlying server. If the trace directed to the proxy the response will be made in compliance to HTTP 1.1 RFC.

Author:
Anders Nyman

Field Summary
 
Fields inherited from class net.sf.j2ep.responsehandlers.ResponseHandlerBase
method
 
Constructor Summary
TraceResponseHandler(org.apache.commons.httpclient.methods.TraceMethod method)
          Basic constructor setting the method, and also checks if the request is targeted to the proxy or the underlying server.
 
Method Summary
 int getStatusCode()
          Returns 200 if the request is targeted to the proxy otherwise the normal status code is returned.
 void process(HttpServletResponse response)
          Will either respond with data from the underlying server or the proxy's own data.
 
Methods inherited from class net.sf.j2ep.responsehandlers.ResponseHandlerBase
close, sendStreamToClient, setHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceResponseHandler

public TraceResponseHandler(org.apache.commons.httpclient.methods.TraceMethod method)
Basic constructor setting the method, and also checks if the request is targeted to the proxy or the underlying server.

Parameters:
method - The http method
Method Detail

process

public void process(HttpServletResponse response)
             throws java.io.IOException
Will either respond with data from the underlying server or the proxy's own data.

Specified by:
process in interface ResponseHandler
Specified by:
process in class ResponseHandlerBase
Parameters:
response - The response to process
Throws:
java.io.IOException - An exception is thrown when there is a problem with writing the output
See Also:
net.sf.j2ep.model.ResponseHandler#process(javax.servlet.http.HttpServletResponse)

getStatusCode

public int getStatusCode()
Returns 200 if the request is targeted to the proxy otherwise the normal status code is returned.

Specified by:
getStatusCode in interface ResponseHandler
Overrides:
getStatusCode in class ResponseHandlerBase
Returns:
The status code
See Also:
ResponseHandler.getStatusCode()