rabbit.proxy
Class StandardResponseHeaders

java.lang.Object
  extended by rabbit.proxy.StandardResponseHeaders

public class StandardResponseHeaders
extends java.lang.Object

A class that can create standard response headers.


Constructor Summary
StandardResponseHeaders(Connection con)
           
 
Method Summary
 HTTPHeader get200()
          Get a 200 Ok header
 HTTPHeader get206(java.lang.String ifRange, HTTPHeader header)
           
 HTTPHeader get304(HTTPHeader oldresp)
          Get a 304 Not Modified header for the given old header
 HTTPHeader get400(java.lang.Exception exception)
          Get a 400 Bad Request header for the given exception.
 HTTPHeader get403()
          Get a 403 Forbidden header.
 HTTPHeader get407(java.lang.String realm, java.net.URL url)
          Get a 407 Proxy Authentication Required for the given realm and url.
 HTTPHeader get412()
          Get a 412 Precondition Failed header.
 HTTPHeader get416(java.lang.Throwable exception)
          Get a Requested Range Not Satisfiable for the given exception.
 HTTPHeader get417(java.lang.String expectation)
          Get a 417 Expectation Failed header.
 HTTPHeader get500(java.lang.Throwable exception)
          Get a 500 Internal Server Error header for the given exception.
 HTTPHeader get504(java.lang.Throwable exception, java.lang.String requestLine)
          Get a 504 Gateway Timeout for the given exception.
 HTTPHeader getHeader()
          Get a new HTTPHeader.
 HTTPHeader getHeader(java.lang.String statusLine)
          Get a new HTTPHeader initialized with some data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardResponseHeaders

public StandardResponseHeaders(Connection con)
Method Detail

getHeader

public HTTPHeader getHeader()
Get a new HTTPHeader. This is the same as getHeader ("HTTP/1.0 200 OK");

Returns:
a new HTTPHeader.

getHeader

public HTTPHeader getHeader(java.lang.String statusLine)
Get a new HTTPHeader initialized with some data.

Parameters:
statusLine - the statusline of the response.
Returns:
a new HTTPHeader.

get200

public HTTPHeader get200()
Get a 200 Ok header

Returns:
a 200 HTTPHeader .

get206

public HTTPHeader get206(java.lang.String ifRange,
                         HTTPHeader header)

get304

public HTTPHeader get304(HTTPHeader oldresp)
Get a 304 Not Modified header for the given old header

Parameters:
oldresp - the cached header.
Returns:
a 304 HTTPHeader .

get400

public HTTPHeader get400(java.lang.Exception exception)
Get a 400 Bad Request header for the given exception.

Parameters:
exception - the Exception handled.
Returns:
a HTTPHeader for the exception.

get403

public HTTPHeader get403()
Get a 403 Forbidden header.

Returns:
a HTTPHeader.

get407

public HTTPHeader get407(java.lang.String realm,
                         java.net.URL url)
Get a 407 Proxy Authentication Required for the given realm and url.

Parameters:
realm - the realm that requires auth.
url - the URL of the request made.
Returns:
a suitable HTTPHeader.

get412

public HTTPHeader get412()
Get a 412 Precondition Failed header.

Returns:
a suitable HTTPHeader.

get416

public HTTPHeader get416(java.lang.Throwable exception)
Get a Requested Range Not Satisfiable for the given exception.

Parameters:
exception - the Exception made.
Returns:
a suitable HTTPHeader.

get417

public HTTPHeader get417(java.lang.String expectation)
Get a 417 Expectation Failed header.

Parameters:
expectation - the expectation that failed.
Returns:
a suitable HTTPHeader.

get500

public HTTPHeader get500(java.lang.Throwable exception)
Get a 500 Internal Server Error header for the given exception.

Parameters:
exception - the Exception made.
Returns:
a suitable HTTPHeader.

get504

public HTTPHeader get504(java.lang.Throwable exception,
                         java.lang.String requestLine)
Get a 504 Gateway Timeout for the given exception.

Parameters:
exception - the Exception made.
Returns:
a suitable HTTPHeader.