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) |
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) |
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) |
BaseResponse |
setValidator(Validator validator) |
public BaseResponse(int statusCode, String baseUrl, byte[] content, org.apache.http.entity.ContentType contentType, org.apache.http.Header[] headers, org.apache.http.HttpHost proxy)
public BaseResponse setSourceId(String sourceId)
public BaseResponse setValidator(Validator validator)
public int getStatusCode()
Response
getStatusCode
in interface Response
public byte[] getContent()
Response
getContent
in interface Response
public org.apache.http.entity.ContentType getContentType()
Response
This is provided by the server or guessed by the server or an amalgamation of both
getContentType
in interface Response
public org.apache.http.Header[] getHeaders()
Response
getHeaders
in interface Response
public String getBaseUrl()
Response
getBaseUrl
in interface Response
public org.apache.http.HttpHost getProxy()
Response
public Validator getValidator()
Response
getValidator
in interface Response
public String getSourceId()
Retrievable
This string should be null if no implementation of FileManager is specified during the initialisation of the fetcher
getSourceId
in interface Retrievable
Copyright © 2018. All rights reserved.