net.sf.j2ep.responsehandlers
Class OptionsResponseHandler

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

public class OptionsResponseHandler
extends ResponseHandlerBase

Handler for the OPTIONS method. Will process the Allow header so that no methods that the backing server can handle but we can't are being sent to the client.

Author:
Anders Nyman

Field Summary
 
Fields inherited from class net.sf.j2ep.responsehandlers.ResponseHandlerBase
method
 
Constructor Summary
OptionsResponseHandler(org.apache.commons.httpclient.methods.OptionsMethod method)
          Constructor checking if we should handle the Allow header ourself or respond with the backing servers header.
 
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 check if we are to handle this request, if so the http methods allowed by this proxy is returned in the Allow header.
 
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

OptionsResponseHandler

public OptionsResponseHandler(org.apache.commons.httpclient.methods.OptionsMethod method)
Constructor checking if we should handle the Allow header ourself or respond with the backing servers header.

Parameters:
method - The method for this response
Method Detail

process

public void process(HttpServletResponse response)
Will check if we are to handle this request, if so the http methods allowed by this proxy is returned in the Allow header. If it is a request meant for the backing server its allowed method will be returned.

Specified by:
process in interface ResponseHandler
Specified by:
process in class ResponseHandlerBase
Parameters:
response - The response to process
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()