#include <xmltooling/util/NDC.h>
#include <xmltooling/util/ReloadableXMLFile.h>
+#include <xmltooling/validation/ValidatorSuite.h>
using namespace opensaml::saml2md;
using namespace xmltooling::logging;
);
// Preprocess the metadata.
+ if (!m_validate) {
+ try {
+ SchemaValidators.validate(xmlObject.get());
+ }
+ catch (exception& ex) {
+ m_log.error("metadata intance failed manual schema validation checking: %s", ex.what());
+ throw MetadataException("Metadata instance failed manual schema validation checking.");
+ }
+ }
doFilters(*xmlObject.get());
xmlObject->releaseThisAndChildrenDOM();
xmlObject->setDocument(NULL);
void XMLMetadataProvider::index()
{
+ time_t exp = SAMLTIME_MAX;
+
clearDescriptorIndex();
EntitiesDescriptor* group=dynamic_cast<EntitiesDescriptor*>(m_object);
if (group) {
- AbstractMetadataProvider::index(group, SAMLTIME_MAX);
+ if (!m_local && group->getCacheDuration())
+ exp = time(NULL) + group->getCacheDurationEpoch();
+ AbstractMetadataProvider::index(group, exp);
return;
}
EntityDescriptor* site=dynamic_cast<EntityDescriptor*>(m_object);
- AbstractMetadataProvider::index(site, SAMLTIME_MAX);
+ if (!m_local && site->getCacheDuration())
+ exp = time(NULL) + site->getCacheDurationEpoch();
+ AbstractMetadataProvider::index(site, exp);
}