Package org.hcjf.io.net.http
Class HttpResponse
- java.lang.Object
-
- org.hcjf.io.net.http.HttpPackage
-
- org.hcjf.io.net.http.HttpResponse
-
- Direct Known Subclasses:
HttpPipelineResponse,LayeredResponse
public class HttpResponse extends HttpPackage
This class represents a http response package.- Author:
- javaito
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hcjf.io.net.http.HttpPackage
HttpPackage.ChunkedDecoderLayer, HttpPackage.HttpProtocol, HttpPackage.TransferDecodingLayerInterface
-
-
Field Summary
-
Fields inherited from class org.hcjf.io.net.http.HttpPackage
HTTP_CONTEXT_SEPARATOR, HTTP_FIELD_ASSIGNATION, HTTP_FIELD_SEPARATOR, HTTP_FIELD_START, LINE_FIELD_SEPARATOR, STRING_LINE_SEPARATOR
-
-
Constructor Summary
Constructors Modifier Constructor Description HttpResponse()protectedHttpResponse(HttpResponse httpResponse)
-
Method Summary
Modifier and Type Method Description byte[]getProtocolHeader()Return the byte array that represents the http package header.java.lang.StringgetReasonPhrase()Return a phrase that represents why the server response with this package.java.lang.IntegergetResponseCode()Return the numeric code that represents the status of the http request.protected voidprocessBody()This kind of http package never process his body.protected voidprocessFirstLine(java.lang.String firstLine)Set the values of the first line of the package.voidsetReasonPhrase(java.lang.String reasonPhrase)Set a phrase that represents why the server response with this package.voidsetResponseCode(java.lang.Integer responseCode)Set the numeric code that represents the status of the http request.java.lang.StringtoString()Create the standard representation of the http response package.-
Methods inherited from class org.hcjf.io.net.http.HttpPackage
addCookie, addData, addHeader, bodyDone, containsCookie, containsHeader, getBody, getCookie, getCookies, getHeader, getHeaders, getHttpVersion, getProtocol, isComplete, setBody, setHttpVersion, setProtocol, trimBody
-
-
-
-
Constructor Detail
-
HttpResponse
public HttpResponse()
-
HttpResponse
protected HttpResponse(HttpResponse httpResponse)
-
-
Method Detail
-
getResponseCode
public java.lang.Integer getResponseCode()
Return the numeric code that represents the status of the http request.- Returns:
- Response code.
-
setResponseCode
public void setResponseCode(java.lang.Integer responseCode)
Set the numeric code that represents the status of the http request.- Parameters:
responseCode- Response code.
-
getReasonPhrase
public java.lang.String getReasonPhrase()
Return a phrase that represents why the server response with this package.- Returns:
- Reason phrase.
-
setReasonPhrase
public void setReasonPhrase(java.lang.String reasonPhrase)
Set a phrase that represents why the server response with this package.- Parameters:
reasonPhrase- Reason phrase.
-
processBody
protected void processBody()
This kind of http package never process his body.- Specified by:
processBodyin classHttpPackage
-
processFirstLine
protected void processFirstLine(java.lang.String firstLine)
Set the values of the first line of the package.- Specified by:
processFirstLinein classHttpPackage- Parameters:
firstLine- String representation of the firs line.
-
getProtocolHeader
public byte[] getProtocolHeader()
Return the byte array that represents the http package header.- Specified by:
getProtocolHeaderin classHttpPackage- Returns:
- Byte array.
-
toString
public java.lang.String toString()
Create the standard representation of the http response package.- Overrides:
toStringin classjava.lang.Object- Returns:
- String representation of the package
-
-