simple.http.serve
Interface Report

All Known Implementing Classes:
ErrorReport, StatusReport

public interface Report

The Report interface is used to describe a HTTP response message. Reporting the various HTTP error and status messages requires that a status code and textual description be provided in the response, also depending on the type of response a description of the cause can be provided in the HTTP message body.

The getCode method must return a valid HTTP status code so that it can be used to describe the response, also the getText method must supply a short description of the response. For example, a description for the 404 HTTP status code would be 'File Not Found', for more information of valid descriptions see RFC 2616 section 6.1.1.

Author:
Niall Gallagher

Method Summary
 java.lang.String getCause()
          This is used to acquire a detailed message describing the cause of the error.
 int getCode()
          Returns the HTTP status code that this report represents.
 java.lang.String getText()
          Returns a short description of what caused this report.
 

Method Detail

getCode

int getCode()
Returns the HTTP status code that this report represents. This will typically describe an error using one of the 4xx or 5xx HTTP status codes. For details on the specific types of status codes used by HTTP/1.1 see RFC 2616 section 6.1.1.

Returns:
the HTTP status code this report represents

getText

java.lang.String getText()
Returns a short description of what caused this report. This will typically describe an error using one of the 4xx or 5xx HTTP status codes. For details on the specific types of status codes used by HTTP/1.1 see RFC 2616 section 6.1.1.

Returns:
the short description of what caused the report

getCause

java.lang.String getCause()
This is used to acquire a detailed message describing the cause of the error. Typically this will display exceptions caught while processing a HTTP request. The exception can be reported using the printStackTrace method.

Returns:
a detailed description of what caused the report