rabbit.proxy
Interface HttpGenerator


public interface HttpGenerator

An interface describing the methods for http header generation.

Author:
Robert Olofsson

Method Summary
 HttpHeader get200()
          Get a 200 Ok header
 HttpHeader get206(String ifRange, HttpHeader header)
          Get a 206 Partial Content header.
 HttpHeader get304(HttpHeader oldresp)
          Get a 304 Not Modified header for the given old header
 HttpHeader get400(Exception exception)
          Get a 400 Bad Request header for the given exception.
 HttpHeader get401(URL url, String realm)
          Get a 401 Authentication Required for the given realm and url.
 HttpHeader get403()
          Get a 403 Forbidden header.
 HttpHeader get404(String file)
          Get a 404 File not found header.
 HttpHeader get407(URL url, String realm)
          Get a 407 Proxy Authentication Required for the given realm and url.
 HttpHeader get412()
          Get a 412 Precondition Failed header.
 HttpHeader get414()
          Get a 414 Request-URI Too Long header.
 HttpHeader get416(Throwable exception)
          Get a Requested Range Not Satisfiable for the given exception.
 HttpHeader get417(String expectation)
          Get a 417 Expectation Failed header.
 HttpHeader get500(String requestURL, Throwable exception)
          Get a 500 Internal Server Error header for the given exception.
 HttpHeader get504(String requestURL, Throwable exception)
          Get a 504 Gateway Timeout for the given exception.
 HttpHeader getHeader()
          Get a new HttpHeader.
 

Method Detail

getHeader

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

Returns:
a new HttpHeader.

get200

HttpHeader get200()
Get a 200 Ok header

Returns:
a 200 HttpHeader .

get206

HttpHeader get206(String ifRange,
                  HttpHeader header)
Get a 206 Partial Content header.

Parameters:
ifRange - if the request is a range request.
header - the current HttpHeader.

get304

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

HttpHeader get400(Exception exception)
Get a 400 Bad Request header for the given exception.

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

get401

HttpHeader get401(URL url,
                  String realm)
Get a 401 Authentication Required for the given realm and url.

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

get403

HttpHeader get403()
Get a 403 Forbidden header.

Returns:
a HttpHeader.

get404

HttpHeader get404(String file)
Get a 404 File not found header.

Returns:
a HttpHeader.

get407

HttpHeader get407(URL url,
                  String realm)
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

HttpHeader get412()
Get a 412 Precondition Failed header.

Returns:
a suitable HttpHeader.

get414

HttpHeader get414()
Get a 414 Request-URI Too Long header.

Returns:
a suitable HttpHeader.

get416

HttpHeader get416(Throwable exception)
Get a Requested Range Not Satisfiable for the given exception.

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

get417

HttpHeader get417(String expectation)
Get a 417 Expectation Failed header.

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

get500

HttpHeader get500(String requestURL,
                  Throwable exception)
Get a 500 Internal Server Error header for the given exception.

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

get504

HttpHeader get504(String requestURL,
                  Throwable exception)
Get a 504 Gateway Timeout for the given exception.

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