public class BaseResponse extends Object implements Response, Retrievable
| Constructor and Description |
|---|
BaseResponse(int statusCode,
String baseUrl,
byte[] content,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] headers,
org.apache.http.HttpHost proxy)
Constructs a base response.
|
BaseResponse(int statusCode,
String baseUrl,
byte[] content,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] headers,
org.apache.http.HttpHost proxy,
Validator validator,
String sourceId)
Constructs a base response.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getBaseUrl()
Returns the base form of the url used in this request.
|
byte[] |
getContent()
Returns raw content of the response.
|
org.apache.http.entity.ContentType |
getContentType()
Returns the content type of the content fetched.
|
org.apache.http.Header[] |
getHeaders()
Returns the headers that were used to trigger this response.
|
org.apache.http.HttpHost |
getProxy()
Returns the proxy that was used to trigger this response.
|
String |
getSourceId()
Returns the id of the row where an archive of this response
has been insert into a persistent storage.
|
int |
getStatusCode()
Returns status code of the response.
|
Validator |
getValidator()
Returns the instance of validator used to validate this response.
|
BaseResponse |
setSourceId(String sourceId)
Sets the source id where the raw response is saved.
|
BaseResponse |
setValidator(Validator validator)
Sets the validator used to validate this response.
|
public BaseResponse(int statusCode,
String baseUrl,
byte[] content,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] headers,
org.apache.http.HttpHost proxy)
statusCode - Status code of the responsebaseUrl - Base url of the responsecontent - Content from the responsecontentType - Content type of the responseheaders - Headers from the responseproxy - Proxy used to obtain the responsepublic BaseResponse(int statusCode,
String baseUrl,
byte[] content,
org.apache.http.entity.ContentType contentType,
org.apache.http.Header[] headers,
org.apache.http.HttpHost proxy,
Validator validator,
String sourceId)
statusCode - Status code of the responsebaseUrl - Base url of the responsecontent - Content from the responsecontentType - Content type of the responseheaders - Headers from the responseproxy - Proxy used to obtain the responsevalidator - Validator used to validate this responsesourceId - `id` of the row the raw response is saved topublic final int getStatusCode()
ResponsegetStatusCode in interface Responsepublic final byte[] getContent()
ResponsegetContent in interface Responsepublic final org.apache.http.entity.ContentType getContentType()
ResponseThis is provided by the server or guessed by the server or an amalgamation of both.
getContentType in interface Responsepublic final org.apache.http.Header[] getHeaders()
ResponsegetHeaders in interface Responsepublic final String getBaseUrl()
ResponsegetBaseUrl in interface Responsepublic final org.apache.http.HttpHost getProxy()
Responsepublic final Validator getValidator()
ResponsegetValidator in interface Responsepublic final BaseResponse setValidator(Validator validator)
validator - Row id of the saved responsepublic final String getSourceId()
RetrievableThis string should be null if no implementation of FileManager is specified during the initialisation of the fetcher.
getSourceId in interface Retrievablepublic final BaseResponse setSourceId(String sourceId)
sourceId - Row id of the saved responseCopyright © 2019. All rights reserved.