Package ai.preferred.venom.storage
Class StorageRecord<T>
- java.lang.Object
-
- ai.preferred.venom.storage.StorageRecord<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StorageRecord.Builder<T>
A builder for StorageRecord class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> StorageRecord.Builder<T>
builder()
Create an instance of builder.org.apache.http.entity.ContentType
getContentType()
long
getDateCreated()
T
getId()
java.lang.String
getMD5()
Get md5 hash of the response content.java.util.Map<java.lang.String,java.lang.String>
getRequestBody()
java.util.Map<java.lang.String,java.lang.String>
getRequestHeaders()
Request.Method
getRequestMethod()
byte[]
getResponseContent()
org.apache.http.Header[]
getResponseHeaders()
int
getStatusCode()
java.lang.String
getURL()
-
-
-
Method Detail
-
builder
public static <T> StorageRecord.Builder<T> builder()
Create an instance of builder.- Type Parameters:
T
- the type of id- Returns:
- a new instance of builder
-
getId
public T getId()
-
getURL
public java.lang.String getURL()
-
getRequestMethod
public Request.Method getRequestMethod()
- Specified by:
getRequestMethod
in interfaceRecord<T>
- Returns:
- Request type
-
getRequestHeaders
public java.util.Map<java.lang.String,java.lang.String> getRequestHeaders()
- Specified by:
getRequestHeaders
in interfaceRecord<T>
- Returns:
- map of request headers
-
getRequestBody
public java.util.Map<java.lang.String,java.lang.String> getRequestBody()
- Specified by:
getRequestBody
in interfaceRecord<T>
- Returns:
- map of request body
-
getStatusCode
public int getStatusCode()
- Specified by:
getStatusCode
in interfaceRecord<T>
- Returns:
- status code
-
getResponseHeaders
public org.apache.http.Header[] getResponseHeaders()
- Specified by:
getResponseHeaders
in interfaceRecord<T>
- Returns:
- BaseResponse headers
-
getContentType
public org.apache.http.entity.ContentType getContentType()
- Specified by:
getContentType
in interfaceRecord<T>
- Returns:
- ContentType of the content
-
getResponseContent
public byte[] getResponseContent()
- Specified by:
getResponseContent
in interfaceRecord<T>
- Returns:
- raw response file (uncompressed)
-
getDateCreated
public long getDateCreated()
- Specified by:
getDateCreated
in interfaceRecord<T>
- Returns:
- valid timestamp if the record is stored, -1 otherwise
-
getMD5
public java.lang.String getMD5()
Get md5 hash of the response content.- Returns:
- md5 hash of the response content
-
-