Search in sources :

Example 1 with AbstractReloadingMetadataResolver

use of org.opensaml.saml.metadata.resolver.impl.AbstractReloadingMetadataResolver in project verify-hub by alphagov.

the class SamlEngineModule method registerMetadataRefreshTask.

@Provides
@Named("VERIFY_METADATA_REFRESH_TASK")
@Singleton
private Task registerMetadataRefreshTask(Environment environment, @Named(VERIFY_METADATA_RESOLVER) MetadataResolver metadataResolver) {
    Task task = new Task("metadata-refresh") {

        @Override
        public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception {
            ((AbstractReloadingMetadataResolver) metadataResolver).refresh();
        }
    };
    environment.admin().addTask(task);
    return task;
}
Also used : Task(io.dropwizard.servlets.tasks.Task) AbstractReloadingMetadataResolver(org.opensaml.saml.metadata.resolver.impl.AbstractReloadingMetadataResolver) Map(java.util.Map) PrintWriter(java.io.PrintWriter) Named(javax.inject.Named) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Example 2 with AbstractReloadingMetadataResolver

use of org.opensaml.saml.metadata.resolver.impl.AbstractReloadingMetadataResolver in project verify-hub by alphagov.

the class HubMetadataPublicKeyStoreTest method initializeMetadata.

private static MetadataResolver initializeMetadata(String xml) throws ComponentInitializationException {
    AbstractReloadingMetadataResolver metadataResolver = new StringBackedMetadataResolver(xml);
    BasicParserPool basicParserPool = new BasicParserPool();
    basicParserPool.initialize();
    metadataResolver.setParserPool(basicParserPool);
    metadataResolver.setId("testResolver");
    metadataResolver.setRequireValidMetadata(true);
    metadataResolver.initialize();
    return metadataResolver;
}
Also used : BasicParserPool(net.shibboleth.utilities.java.support.xml.BasicParserPool) AbstractReloadingMetadataResolver(org.opensaml.saml.metadata.resolver.impl.AbstractReloadingMetadataResolver)

Aggregations

AbstractReloadingMetadataResolver (org.opensaml.saml.metadata.resolver.impl.AbstractReloadingMetadataResolver)2 Provides (com.google.inject.Provides)1 Task (io.dropwizard.servlets.tasks.Task)1 PrintWriter (java.io.PrintWriter)1 Map (java.util.Map)1 Named (javax.inject.Named)1 Singleton (javax.inject.Singleton)1 BasicParserPool (net.shibboleth.utilities.java.support.xml.BasicParserPool)1