@Contract(threading=IMMUTABLE)
class ConditionalRequestBuilder
extends java.lang.Object
Constructor and Description |
---|
ConditionalRequestBuilder() |
Modifier and Type | Method and Description |
---|---|
HttpRequestWrapper |
buildConditionalRequest(HttpRequestWrapper request,
HttpCacheEntry cacheEntry)
When a
HttpCacheEntry is stale but 'might' be used as a response
to an HttpRequest we will attempt to revalidate
the entry with the origin. |
HttpRequestWrapper |
buildConditionalRequestFromVariants(HttpRequestWrapper request,
java.util.Map<java.lang.String,Variant> variants)
When a
HttpCacheEntry does not exist for a specific
HttpRequest we attempt to see if an existing
HttpCacheEntry is appropriate by building a conditional
HttpRequest using the variants' ETag values. |
HttpRequestWrapper |
buildUnconditionalRequest(HttpRequestWrapper request,
HttpCacheEntry entry)
Returns a request to unconditionally validate a cache entry with
the origin.
|
public HttpRequestWrapper buildConditionalRequest(HttpRequestWrapper request, HttpCacheEntry cacheEntry) throws org.apache.http.ProtocolException
HttpCacheEntry
is stale but 'might' be used as a response
to an HttpRequest
we will attempt to revalidate
the entry with the origin. Build the origin HttpRequest
here and return it.request
- the original request from the callercacheEntry
- the entry that needs to be re-validatedorg.apache.http.ProtocolException
- when I am unable to build a new origin request.public HttpRequestWrapper buildConditionalRequestFromVariants(HttpRequestWrapper request, java.util.Map<java.lang.String,Variant> variants)
HttpCacheEntry
does not exist for a specific
HttpRequest
we attempt to see if an existing
HttpCacheEntry
is appropriate by building a conditional
HttpRequest
using the variants' ETag values.
If no such values exist, the request is unmodifiedrequest
- the original request from the callervariants
- public HttpRequestWrapper buildUnconditionalRequest(HttpRequestWrapper request, HttpCacheEntry entry)
request
- client request we are trying to satisfyentry
- existing cache entry we are trying to validate