checkValidity = false;
}
if (checkValidity) {
final ExpiresValidity cacheValidity = (ExpiresValidity) this.response.getValidityObjects()[0];
final SourceValidity sourceValidity = this.response.getValidityObjects()[1];
boolean remove = false;
if (this.expires == 0) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Force invalidation of cached response" +
" of source " + getSourceURI());
}
remove = true;
}
else {
boolean expired = cacheValidity.isValid() != SourceValidity.VALID;
if (expired) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Cached response of source "
+ getSourceURI() + " is expired.");
}
boolean invalid = !isValid(sourceValidity, this.source);
if (invalid) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Cached response of source "
+ getSourceURI() + " is invalid.");
}
remove = true;
}
else {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Cached response of source "
+ getSourceURI() + " is still valid.");
}
// set new expiration period
this.response.getValidityObjects()[0] = new ExpiresValidity(getExpiration());
}
}
}
if (remove) {