simple.http.serve
Class StatusReport

java.lang.Object
  extended by simple.http.serve.StatusReport
All Implemented Interfaces:
Report

public class StatusReport
extends java.lang.Object
implements Report

The StatusReport is used to describe HTTP status messages. Reporting the various HTTP status messages requires that status codes and textual descriptions of the status are provided. This will pair a provided status code with a short description of the status that HTTP status code represents as outlined by RFC 2612 section 6.1.1.

The getCause method will provide an empty description of the cause, as changes in status are typically driven by the service implementations and therefore are not directly caused by any specific event.

Author:
Niall Gallagher

Field Summary
protected static java.util.ResourceBundle status
          This is used to load the Error.properties file for a list of the matching HTTP status messages.
 
Constructor Summary
StatusReport(int code)
          Constructor for the StatusReport object.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

status

protected static java.util.ResourceBundle status
This is used to load the Error.properties file for a list of the matching HTTP status messages.

Constructor Detail

StatusReport

public StatusReport(int code)
Constructor for the StatusReport object. This will create an instance that uses the HTTP status code provided to describe the status report.

Parameters:
code - this is the HTTP status code of the report
Method Detail

getCode

public int getCode()
Returns the HTTP status code that this report represents. This can be used to describe a chenge in status using any of the valid HTTP status codes described in RFC 2616 section 6.1.1, typically this will be a 2xx, 3xx, 4xx, or 5xx code.

Specified by:
getCode in interface Report
Returns:
the HTTP status code this report represents

getText

public java.lang.String getText()
Returns a short description of what caused this report. This can be used to describe a chenge in status using any of the valid HTTP status codes described in RFC 2616 section 6.1.1, typically this will be a 2xx, 3xx, 4xx, or 5xx code.

Specified by:
getText in interface Report
Returns:
the short description of what caused the report

getCause

public java.lang.String getCause()
This is used to acquire a detailed message describing the cause of the error. For this implementation there will be no direct cause for the status report as this is typically used as a result of a change in status by the service.

Specified by:
getCause in interface Report
Returns:
this provides an empty string for the cause