public class AsynchronousValidationRequest
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private HttpCacheEntry |
cacheEntry |
private CachingExec |
cachingExec |
private int |
consecutiveFailedAttempts |
private HttpClientContext |
context |
private HttpExecutionAware |
execAware |
private java.lang.String |
identifier |
private org.apache.commons.logging.Log |
log |
private AsynchronousValidator |
parent |
private HttpRequestWrapper |
request |
private HttpRoute |
route |
Constructor and Description |
---|
AsynchronousValidationRequest(AsynchronousValidator parent,
CachingExec cachingExec,
HttpRoute route,
HttpRequestWrapper request,
HttpClientContext context,
HttpExecutionAware execAware,
HttpCacheEntry cacheEntry,
java.lang.String identifier,
int consecutiveFailedAttempts)
Used internally by
AsynchronousValidator to schedule a
revalidation. |
Modifier and Type | Method and Description |
---|---|
int |
getConsecutiveFailedAttempts()
The number of consecutively failed revalidation attempts.
|
java.lang.String |
getIdentifier() |
private boolean |
isNotServerError(int statusCode)
Return whether the status code indicates a server error or not.
|
private boolean |
isNotStale(org.apache.http.HttpResponse httpResponse)
Try to detect if the returned response is generated from a stale cache entry.
|
private boolean |
revalidateCacheEntry()
Revalidate the cache entry and return if the operation was successful.
|
void |
run() |
private final AsynchronousValidator parent
private final CachingExec cachingExec
private final HttpRoute route
private final HttpRequestWrapper request
private final HttpClientContext context
private final HttpExecutionAware execAware
private final HttpCacheEntry cacheEntry
private final java.lang.String identifier
private final int consecutiveFailedAttempts
private final org.apache.commons.logging.Log log
AsynchronousValidationRequest(AsynchronousValidator parent, CachingExec cachingExec, HttpRoute route, HttpRequestWrapper request, HttpClientContext context, HttpExecutionAware execAware, HttpCacheEntry cacheEntry, java.lang.String identifier, int consecutiveFailedAttempts)
AsynchronousValidator
to schedule a
revalidation.request
- context
- cacheEntry
- identifier
- consecutiveFailedAttempts
- public void run()
run
in interface java.lang.Runnable
private boolean revalidateCacheEntry()
true
if the cache entry was successfully validated;
otherwise false
private boolean isNotServerError(int statusCode)
statusCode
- the status code to be checkedprivate boolean isNotStale(org.apache.http.HttpResponse httpResponse)
httpResponse
- the response to be checkedpublic java.lang.String getIdentifier()
public int getConsecutiveFailedAttempts()