/** * Processes a cached metadata document in order to determine, and schedule, the next time it should be refreshed. * * @param metadataIdentifier identifier of the metadata source * @param refreshStart when the current refresh cycle started * * @throws MetadataProviderException throw is there is a problem process the cached metadata */ protected void processCachedMetadata(String metadataIdentifier, DateTime refreshStart) throws MetadataProviderException { log.debug("Computing new expiration time for cached metadata from '{}", metadataIdentifier); DateTime metadataExpirationTime = SAML2Helper .getEarliestExpiration(cachedMetadata, refreshStart.plus(getMaxRefreshDelay()), refreshStart); expirationTime = metadataExpirationTime; long nextRefreshDelay = computeNextRefreshDelay(expirationTime); nextRefresh = new DateTime(ISOChronology.getInstanceUTC()).plus(nextRefreshDelay); }
SAML2Helper.getEarliestExpiration(metadata, refreshStart.plus(getMaxRefreshDelay()), refreshStart); log.debug("Expiration of metadata from '{}' will occur at {}", metadataIdentifier, metadataExpirationTime.toString()); if (metadataExpirationTime.isBeforeNow()) { expirationTime = new DateTime(ISOChronology.getInstanceUTC()).plus(getMinRefreshDelay()); nextRefreshDelay = getMaxRefreshDelay(); } else { expirationTime = metadataExpirationTime;