Search in sources :

Example 1 with AbstractMetadataResolver

use of org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver in project cas by apereo.

the class ChainingMetadataResolverCacheLoader method resolveFileSystemBasedMetadataResource.

private void resolveFileSystemBasedMetadataResource(final SamlRegisteredService service, final List<MetadataResolver> metadataResolvers, final AbstractResource metadataResource) throws Exception {
    final File metadataFile = metadataResource.getFile();
    final AbstractMetadataResolver metadataResolver;
    if (metadataFile.isDirectory()) {
        metadataResolver = new LocalDynamicMetadataResolver(new FilesystemLoadSaveManager<>(metadataFile, configBean.getParserPool()));
    } else {
        metadataResolver = new ResourceBackedMetadataResolver(ResourceHelper.of(metadataResource));
    }
    buildSingleMetadataResolver(metadataResolver, service);
    metadataResolvers.add(metadataResolver);
}
Also used : ResourceBackedMetadataResolver(org.opensaml.saml.metadata.resolver.impl.ResourceBackedMetadataResolver) AbstractMetadataResolver(org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver) LocalDynamicMetadataResolver(org.opensaml.saml.metadata.resolver.impl.LocalDynamicMetadataResolver) FilesystemLoadSaveManager(org.opensaml.core.xml.persist.FilesystemLoadSaveManager) File(java.io.File)

Aggregations

File (java.io.File)1 FilesystemLoadSaveManager (org.opensaml.core.xml.persist.FilesystemLoadSaveManager)1 AbstractMetadataResolver (org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver)1 LocalDynamicMetadataResolver (org.opensaml.saml.metadata.resolver.impl.LocalDynamicMetadataResolver)1 ResourceBackedMetadataResolver (org.opensaml.saml.metadata.resolver.impl.ResourceBackedMetadataResolver)1