|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.client.cache.HttpCacheEntry
@Immutable public class HttpCacheEntry
Structure used to store an HttpResponse
in a cache. Some entries
can optionally depend on system resources that may require explicit
deallocation. In such a case getResource()
should return a non
null instance of Resource
that must be deallocated by calling
Resource.dispose()
method when no longer used.
Constructor Summary | |
---|---|
HttpCacheEntry(Date requestDate,
Date responseDate,
StatusLine statusLine,
Header[] responseHeaders,
Resource resource)
Create a new HttpCacheEntry . |
|
HttpCacheEntry(Date requestDate,
Date responseDate,
StatusLine statusLine,
Header[] responseHeaders,
Resource resource,
Map<String,String> variantMap)
Create a new HttpCacheEntry with variants. |
Method Summary | |
---|---|
Header[] |
getAllHeaders()
Returns all the headers that were on the origin response. |
Header |
getFirstHeader(String name)
Returns the first header from the origin response with the given name. |
Header[] |
getHeaders(String name)
Gets all the headers with the given name that were on the origin response. |
ProtocolVersion |
getProtocolVersion()
Returns the ProtocolVersion from the origin HttpResponse . |
String |
getReasonPhrase()
Gets the reason phrase from the origin HttpResponse , for example,
"Not Modified". |
Date |
getRequestDate()
Returns the time the associated origin request was initiated by the caching module. |
Resource |
getResource()
Returns the Resource containing the origin response body. |
Date |
getResponseDate()
Returns the time the origin response was received by the caching module. |
int |
getStatusCode()
Returns the HTTP response code from the origin HttpResponse . |
StatusLine |
getStatusLine()
Returns the StatusLine from the origin HttpResponse . |
Map<String,String> |
getVariantMap()
Returns an index about where in the cache different variants for a given resource are stored. |
boolean |
hasVariants()
Indicates whether the origin response indicated the associated resource had variants (i.e. |
String |
toString()
Provides a string representation of this instance suitable for human consumption. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HttpCacheEntry(Date requestDate, Date responseDate, StatusLine statusLine, Header[] responseHeaders, Resource resource, Map<String,String> variantMap)
HttpCacheEntry
with variants.
requestDate
- Date/time when the request was made (Used for age
calculations)responseDate
- Date/time that the response came back (Used for age
calculations)statusLine
- HTTP status line from origin responseresponseHeaders
- Header[] from original HTTP Responseresource
- representing origin response bodyvariantMap
- describing cache entries that are variants
of this parent entry; this maps a "variant key" (derived
from the varying request headers) to a "cache key" (where
in the cache storage the particular variant is located)public HttpCacheEntry(Date requestDate, Date responseDate, StatusLine statusLine, Header[] responseHeaders, Resource resource)
HttpCacheEntry
.
requestDate
- Date/time when the request was made (Used for age
calculations)responseDate
- Date/time that the response came back (Used for age
calculations)statusLine
- HTTP status line from origin responseresponseHeaders
- Header[] from original HTTP Responseresource
- representing origin response bodyMethod Detail |
---|
public StatusLine getStatusLine()
StatusLine
from the origin HttpResponse
.
public ProtocolVersion getProtocolVersion()
ProtocolVersion
from the origin HttpResponse
.
public String getReasonPhrase()
HttpResponse
, for example,
"Not Modified".
public int getStatusCode()
HttpResponse
.
public Date getRequestDate()
Date
public Date getResponseDate()
Date
public Header[] getAllHeaders()
public Header getFirstHeader(String name)
public Header[] getHeaders(String name)
public Resource getResource()
Resource
containing the origin response body.
public boolean hasVariants()
true
if this cached response was a variantpublic Map<String,String> getVariantMap()
HttpCacheStorage
where that
particular variant is stored. The first variant returned is used as
the "parent" entry to hold this index of the other variants.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |