com.radekzitek.userver.http
Class HttpResponseLine

java.lang.Object
  extended bycom.radekzitek.userver.http.HttpStartLine
      extended bycom.radekzitek.userver.http.HttpResponseLine
All Implemented Interfaces:
HttpObject

public class HttpResponseLine
extends HttpStartLine

Author:
rzitek

Field Summary
private static org.apache.log4j.Logger LOG
          Log4j logger.
private  HttpStatusCode statusCode
          Response status code.
private  HttpStatusReason statusReason
          Response status reason string.
private  HttpVersion version
          Http version.
 
Constructor Summary
HttpResponseLine()
          Default constructor for empty start line.
HttpResponseLine(java.lang.String lineString)
          Constructor for the start line using the given input string.
 
Method Summary
 void clear()
          Empties the start line.
 HttpStatusCode getStatusCode()
          Retrieves the status code.
 HttpStatusReason getStatusReason()
          Retrieves the status reason.
 HttpVersion getVersion()
          Retrieves the http version.
 void parse(java.lang.String lineString)
          Parser for the start line using the given input string.
 void setStatusCode(HttpStatusCode statusCode)
          Sets the status code.
 void setStatusReason(HttpStatusReason statusReason)
          Sets the status reason.
 void setVersion(HttpVersion version)
          Sets the http version.
 java.lang.String toString()
          Converts the line to string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG
Log4j logger.


statusCode

private HttpStatusCode statusCode
Response status code.


statusReason

private HttpStatusReason statusReason
Response status reason string.


version

private HttpVersion version
Http version.

Constructor Detail

HttpResponseLine

public HttpResponseLine()
Default constructor for empty start line.


HttpResponseLine

public HttpResponseLine(java.lang.String lineString)
                 throws HttpVersionFormatException,
                        HttpResponseLineFormatException,
                        HttpStatusCodeFormatException
Constructor for the start line using the given input string.

Parameters:
lineString - input string
Throws:
HttpVersionFormatException - Http version string could not parse.
HttpResponseLineFormatException - The input line string did not match the reponse line pattern.
HttpStatusCodeFormatException - The status code did not parse.
Method Detail

clear

public void clear()
Empties the start line.


getStatusCode

public HttpStatusCode getStatusCode()
Retrieves the status code.

Returns:
the status code

getStatusReason

public HttpStatusReason getStatusReason()
Retrieves the status reason.

Returns:
the status reason

getVersion

public HttpVersion getVersion()
Retrieves the http version.

Returns:
the http version

parse

public void parse(java.lang.String lineString)
           throws HttpVersionFormatException,
                  HttpResponseLineFormatException,
                  HttpStatusCodeFormatException
Parser for the start line using the given input string.

Parameters:
lineString - input string
Throws:
HttpVersionFormatException - Http version string could not parse.
HttpResponseLineFormatException - The input line string did not match the reponse line pattern.
HttpStatusCodeFormatException - The status code did not parse.

setStatusCode

public void setStatusCode(HttpStatusCode statusCode)
Sets the status code.

Parameters:
statusCode - the status code to set

setStatusReason

public void setStatusReason(HttpStatusReason statusReason)
Sets the status reason.

Parameters:
statusReason - the status reason to set

setVersion

public void setVersion(HttpVersion version)
Sets the http version.

Parameters:
version - the http version to set

toString

public java.lang.String toString()
Converts the line to string.

See Also:
Object.toString()