@Contract(threading=IMMUTABLE) public class HttpCacheEntryFactory extends Object
HttpCacheEntry
factory.Modifier and Type | Field and Description |
---|---|
static HttpCacheEntryFactory |
INSTANCE
Default instance of
HttpCacheEntryFactory . |
Constructor and Description |
---|
HttpCacheEntryFactory() |
Modifier and Type | Method and Description |
---|---|
HttpCacheEntry |
copy(HttpCacheEntry entry)
Creates a copy of the given
HttpCacheEntry . |
HttpCacheEntry |
create(Instant requestInstant,
Instant responseInstant,
org.apache.hc.core5.http.HttpHost host,
org.apache.hc.core5.http.HttpRequest request,
org.apache.hc.core5.http.HttpResponse response,
Resource resource)
Create a new
HttpCacheEntry with the given Resource . |
HttpCacheEntry |
createRoot(HttpCacheEntry latestVariant,
Collection<String> variants)
Creates a new root
HttpCacheEntry (parent of multiple variants). |
HttpCacheEntry |
createUpdated(Instant requestInstant,
Instant responseInstant,
org.apache.hc.core5.http.HttpHost host,
org.apache.hc.core5.http.HttpRequest request,
org.apache.hc.core5.http.HttpResponse response,
HttpCacheEntry entry)
Creates updated entry with the new information from the response.
|
public static final HttpCacheEntryFactory INSTANCE
HttpCacheEntryFactory
.public HttpCacheEntry createRoot(HttpCacheEntry latestVariant, Collection<String> variants)
HttpCacheEntry
(parent of multiple variants).latestVariant
- The most recently created variant entryvariants
- 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 create(Instant requestInstant, Instant responseInstant, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, Resource resource)
HttpCacheEntry
with the given Resource
.requestInstant
- Date/time when the request was made (Used for age calculations)responseInstant
- Date/time that the response came back (Used for age calculations)host
- Target hostrequest
- Original client request (a deep copy of this object is made)response
- Origin response (a deep copy of this object is made)resource
- Resource representing origin response bodypublic HttpCacheEntry createUpdated(Instant requestInstant, Instant responseInstant, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, HttpCacheEntry entry)
requestInstant
- Date/time when the request was made (Used for age calculations)responseInstant
- Date/time that the response came back (Used for age calculations)host
- Target hostrequest
- Original client request (a deep copy of this object is made)response
- Origin response (a deep copy of this object is made)entry
- Existing cache entry.public HttpCacheEntry copy(HttpCacheEntry entry)
HttpCacheEntry
. Please note the underlying
Resource
is copied by reference.Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.