Interface StatusLine

All Known Subinterfaces:
Response, ResponseHeader
All Known Implementing Classes:
ResponseEntity, ResponseMessage, ResponseWrapper

public interface StatusLine
The StatusLine is used to represent a HTTP status line. This provides several convenience methods that can be used to manipulate a HTTP status line. see the RFC (RFC 2616) for the syntax of a status line.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    This represents the status code of the HTTP response.
    This can be used to retrieve the text of a HTTP status line.
    int
    This can be used to get the major number from a HTTP version.
    int
    This can be used to get the minor number from a HTTP version.
    This is used to acquire the status from the response.
    void
    setCode(int code)
    This method allows the status for the response to be changed.
    void
    This is used to set the text of the HTTP status line.
    void
    setMajor(int major)
    This can be used to specify the major version.
    void
    setMinor(int minor)
    This can be used to specify the minor version.
    void
    setStatus(Status status)
    This is used to set the status code and description for this response.
  • Method Details

    • getCode

      int getCode()
      This represents the status code of the HTTP response. The response code represents the type of message that is being sent to the client. For a description of the codes see RFC 2616 section 10, Status Code Definitions.
      Returns:
      the status code that this HTTP response has
    • setCode

      void setCode(int code)
      This method allows the status for the response to be changed. This MUST be reflected the the response content given to the client. For a description of the codes see RFC 2616 section 10, Status Code Definitions.
      Parameters:
      code - the new status code for the HTTP response
    • getDescription

      String getDescription()
      This can be used to retrieve the text of a HTTP status line. This is the text description for the status code. This should match the status code specified by the RFC.
      Returns:
      the message description of the response
    • setDescription

      void setDescription(String text)
      This is used to set the text of the HTTP status line. This should match the status code specified by the RFC.
      Parameters:
      text - the descriptive text message of the status
    • getStatus

      Status getStatus()
      This is used to acquire the status from the response. The Status object returns represents the code that has been set on the response, it does not necessarily represent the description in the response.
      Returns:
      this is the response for this status line
    • setStatus

      void setStatus(Status status)
      This is used to set the status code and description for this response. Setting the code and description in this manner provides a much more convenient way to set the response status line details.
      Parameters:
      status - this is the status to set on the response
    • getMajor

      int getMajor()
      This can be used to get the major number from a HTTP version. The major version corresponds to the major type that is the 1 of a HTTP/1.0 version string.
      Returns:
      the major version number for the response
    • setMajor

      void setMajor(int major)
      This can be used to specify the major version. This should be the major version of the HTTP request.
      Parameters:
      major - this is the major number desired
    • getMinor

      int getMinor()
      This can be used to get the minor number from a HTTP version. The major version corresponds to the minor type that is the 0 of a HTTP/1.0 version string.
      Returns:
      the major version number for the response
    • setMinor

      void setMinor(int minor)
      This can be used to specify the minor version. This should not be set to zero if the HTTP request was for HTTP/1.1. The response must be equal or higher.
      Parameters:
      minor - this is the minor number desired