public class CachableResponse extends Object implements Serializable
Serializable
,
Serialized FormConstructor and Description |
---|
CachableResponse() |
Modifier and Type | Method and Description |
---|---|
void |
clean()
Sets the responsePayload and the headerProperties to null
|
Map<String,Object> |
getHeaderProperties()
This method gives the HTTP Header Properties of the response
|
String |
getHttpMethod() |
String[] |
getHTTPMethodsToCache()
This method gives the HTTP method that needs to be cached.
|
int |
getMaxMessageSize()
This method gives the maximum size of the messages to be cached in bytes.
|
String |
getProtocolType() |
String |
getRequestHash()
This method gives the hash value of the request payload stored in the cache
|
Pattern |
getResponseCodePattern() |
org.apache.axiom.soap.SOAPEnvelope |
getResponseEnvelope() |
long |
getResponseFetchedTime()
This method returns the originated time of the response.
|
byte[] |
getResponsePayload()
This method gives the cached response payload for json as a byte array
|
String |
getStatusCode() |
Object |
getStatusReason() |
long |
getTimeout()
This method gives the timeout period in milliseconds
|
boolean |
isAddAgeHeaderEnabled()
This method returns whether an Age header needs to be included or not.
|
boolean |
isCacheControlEnabled()
This method returns whether cache-control is enabled or not.
|
boolean |
isJson() |
void |
setAddAgeHeaderEnabled(boolean addAgeHeaderEnabled)
This method sets whether an Age header needs to be included or not.
|
void |
setCacheControlEnabled(boolean cacheControlEnabled)
This method sets whether cache-control is enabled or not.
|
void |
setHeaderProperties(Map<String,Object> headerProperties)
This method sets the HTTP Header Properties of the response
|
void |
setHttpMethod(String httpMethod) |
void |
setHTTPMethodsToCache(String... hTTPMethodToCache)
This sets the HTTP method that needs to be cached.
|
void |
setJson(boolean json)
Sets whether the response content-type is json or not
|
void |
setMaxMessageSize(int maxMessageSize)
This method sets the maximum size of the messages to be cached in bytes.
|
void |
setProtocolType(String protocolType)
This method sets protocolType of the messages.
|
void |
setRequestHash(String requestHash)
This method sets the hash of the request to the cache
|
void |
setResponseCodePattern(Pattern responseCodePattern)
This method sets the response codes that needs to be cached.
|
void |
setResponseEnvelope(org.apache.axiom.soap.SOAPEnvelope responseEnvelope) |
void |
setResponseFetchedTime(long responseFetchedTime)
This method sets the originated time of the response.
|
void |
setResponsePayload(byte[] responsePayload)
This method sets the response payload to the cache as a byte array
|
void |
setStatusCode(String statusCode)
Sets the HTTP status code number of the response
|
void |
setStatusReason(String statusReason)
Sets the HTTP response's Reason-Phrase that is sent by the backend.
|
void |
setTimeout(long timeout)
This method sets the timeout period as milliseconds
|
public void clean()
public byte[] getResponsePayload()
public void setResponsePayload(byte[] responsePayload)
responsePayload
- - response payload to be stored in to the cache as a byte arraypublic org.apache.axiom.soap.SOAPEnvelope getResponseEnvelope()
SOAPEnvelope
for xml responsepublic void setResponseEnvelope(org.apache.axiom.soap.SOAPEnvelope responseEnvelope)
responseEnvelope
- SOAPEnvelope
for xml responsepublic String getRequestHash()
public void setRequestHash(String requestHash)
requestHash
- - hash of the request payload to be set as an Stringpublic long getTimeout()
public void setTimeout(long timeout)
timeout
- - millisecond timeout period to be setpublic Map<String,Object> getHeaderProperties()
public void setHeaderProperties(Map<String,Object> headerProperties)
headerProperties
- HTTP Header Properties to be stored in to cache as a mappublic boolean isJson()
public void setJson(boolean json)
json
- whether the response content-type is json or notpublic String getStatusCode()
public void setStatusCode(String statusCode)
statusCode
- HTTP status code number of the responsepublic Object getStatusReason()
public void setStatusReason(String statusReason)
statusReason
- HTTP response's Reason-Phrase that is sent by the backend.public String[] getHTTPMethodsToCache()
public void setHTTPMethodsToCache(String... hTTPMethodToCache)
hTTPMethodToCache
- the HTTP method to be cachedpublic String getProtocolType()
public void setProtocolType(String protocolType)
protocolType
- protocol type of the messages.public Pattern getResponseCodePattern()
public void setResponseCodePattern(Pattern responseCodePattern)
responseCodePattern
- the response codes pattern to be cached in regex form.public int getMaxMessageSize()
public void setMaxMessageSize(int maxMessageSize)
maxMessageSize
- maximum size of the messages to be set in bytes.public String getHttpMethod()
public void setHttpMethod(String httpMethod)
httpMethod
- the http method of the requestpublic long getResponseFetchedTime()
public void setResponseFetchedTime(long responseFetchedTime)
responseFetchedTime
- originated time of the response.public boolean isCacheControlEnabled()
public void setCacheControlEnabled(boolean cacheControlEnabled)
cacheControlEnabled
- whether cache-control is enabled or not.public boolean isAddAgeHeaderEnabled()
public void setAddAgeHeaderEnabled(boolean addAgeHeaderEnabled)
addAgeHeaderEnabled
- whether an Age header needs to be included or not.Copyright © 2022 WSO2. All rights reserved.