if (this.response == null) return false;
final SourceValidity[] validities = this.response.getValidityObjects();
boolean valid = true;
if (validities.length == 2) {
final ExpiresValidity expiresValidity = (ExpiresValidity) validities[0];
final SourceValidity sourceValidity = validities[1];
if (expiresValidity.isValid() != SourceValidity.VALID) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Cached response of source " + getSourceURI() + " is expired.");
}
if (!isValid(sourceValidity, source.getValidity())) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Cached response of source " + getSourceURI() + " is invalid.");
}
valid = false;
}
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());
}
}
else {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Cached response of source " + getSourceURI() + " is NOT expired.");