private static class HttpCache.DefaultHttpResponse extends java.lang.Object implements HttpResponse
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_body
The HTTP response body.
|
private boolean |
_bodySizeExceeded
Flag to indicate if the HTTP response size exceeded the maximum
allowed by the (default) HttpRequestOptions.
|
private java.lang.String |
_finalUri
The final URI from where the document was obtained,
after following redirects.
|
private int |
_maxRedirectsFollowed
The maximum HTTP redirects limit that was configured
when this HTTP response was obtained.
|
private java.util.Map |
_responseHeaders
Map of header names List of Header objects of the HTTP response.
|
private int |
_statusCode
The status code of the HTTP response.
|
private java.lang.String |
_statusLine
The status line of the HTTP response.
|
private long |
_timestamp
timestamp of creation
(number of milliseconds since January 1, 1970, 00:00:00 GMT)
|
Constructor and Description |
---|
HttpCache.DefaultHttpResponse(int statusCode,
java.lang.String statusLine,
int redirectsFollowed,
java.lang.String finalUri,
org.apache.http.Header[] responseHeaders,
java.lang.String body)
Constructs a new HttpResponse with the provided parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBody()
Gets the HttpResponse body.
|
java.lang.String |
getFinalUri()
Gets the final URI from where the document was obtained,
after following redirects.
|
int |
getMaxRedirectsFollowed()
Gets the maximum HTTP redirects limit that was configured
when this HTTP response was obtained.
|
org.apache.http.Header |
getResponseHeader(java.lang.String headerName)
Gets the first header matching the provided headerName parameter,
or null if no header with that name exists.
|
org.apache.http.Header[] |
getResponseHeaders(java.lang.String headerName)
Gets an array of Header objects for the provided headerName parameter.
|
int |
getStatusCode()
Gets the status code of the HttpResponse.
|
java.lang.String |
getStatusLine()
Gets the status line of the HttpResponse.
|
long |
getTimestamp() |
boolean |
isBodySizeExceeded()
Returns true if the HTTP response size exceeded the maximum
allowed by the (default) HttpRequestOptions.
|
void |
setBodySizeExceeded(boolean bodySizeExceeded)
Sets the flag to indicate whether the HTTP response size exceeded
the maximum allowed by the (default) HttpRequestOptions.
|
private int _statusCode
private java.lang.String _statusLine
private int _maxRedirectsFollowed
private java.lang.String _finalUri
private java.util.Map _responseHeaders
private java.lang.String _body
private boolean _bodySizeExceeded
private long _timestamp
public HttpCache.DefaultHttpResponse(int statusCode, java.lang.String statusLine, int redirectsFollowed, java.lang.String finalUri, org.apache.http.Header[] responseHeaders, java.lang.String body)
public int getStatusCode()
getStatusCode
in interface HttpResponse
public java.lang.String getStatusLine()
public int getMaxRedirectsFollowed()
public java.lang.String getFinalUri()
getFinalUri
in interface HttpResponse
public org.apache.http.Header getResponseHeader(java.lang.String headerName)
getResponseHeader
in interface HttpResponse
public org.apache.http.Header[] getResponseHeaders(java.lang.String headerName)
getResponseHeaders
in interface HttpResponse
public java.lang.String getBody()
getBody
in interface HttpResponse
public boolean isBodySizeExceeded()
isBodySizeExceeded
in interface HttpResponse
public void setBodySizeExceeded(boolean bodySizeExceeded)
public long getTimestamp()
Copyright 2006-2008 Sxip Identity Corporation