Package ai.preferred.venom.response
Class StorageResponse
- java.lang.Object
-
- ai.preferred.venom.response.StorageResponse
-
- All Implemented Interfaces:
Response,Retrievable
public class StorageResponse extends java.lang.Object implements Response, Retrievable
- Author:
- Ween Jiann Lee
-
-
Constructor Summary
Constructors Constructor Description StorageResponse(Record record, java.lang.String baseUrl)Constructs a base response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBaseUrl()Returns the base form of the url used in this request.byte[]getContent()Returns raw content of the response.org.apache.http.entity.ContentTypegetContentType()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.HttpHostgetProxy()Returns the proxy that was used to trigger this response.RecordgetRecord()Returns record archive of this response that has been insert into a persistent storage.intgetStatusCode()Returns status code of the response.
-
-
-
Constructor Detail
-
StorageResponse
public StorageResponse(Record record, java.lang.String baseUrl)
Constructs a base response.- Parameters:
record- record holding this responsebaseUrl- base URL of the response
-
-
Method Detail
-
getStatusCode
public final int getStatusCode()
Description copied from interface:ResponseReturns status code of the response.- Specified by:
getStatusCodein interfaceResponse- Returns:
- int code
-
getContent
public final byte[] getContent()
Description copied from interface:ResponseReturns raw content of the response.- Specified by:
getContentin interfaceResponse- Returns:
- byte[] content
-
getContentType
public final org.apache.http.entity.ContentType getContentType()
Description copied from interface:ResponseReturns the content type of the content fetched.This is provided by the server or guessed by the server or an amalgamation of both.
- Specified by:
getContentTypein interfaceResponse- Returns:
- an instance of ContentType
-
getHeaders
public final org.apache.http.Header[] getHeaders()
Description copied from interface:ResponseReturns the headers that were used to trigger this response.- Specified by:
getHeadersin interfaceResponse- Returns:
- an array of headers
-
getBaseUrl
public final java.lang.String getBaseUrl()
Description copied from interface:ResponseReturns the base form of the url used in this request.- Specified by:
getBaseUrlin interfaceResponse- Returns:
- stripped down version of requested url
-
getProxy
public final org.apache.http.HttpHost getProxy()
Description copied from interface:ResponseReturns the proxy that was used to trigger this response.
-
getRecord
public final Record getRecord()
Description copied from interface:RetrievableReturns record archive of this response that has been insert into a persistent storage.- Specified by:
getRecordin interfaceRetrievable- Returns:
- record where an archive has been saved
-
-