[java-oidc-common] branch main updated: Fix Javadoc and identifier naming

Phil Smart philip.smart at jisc.ac.uk
Wed Mar 9 09:12:26 UTC 2022


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch main
in repository java-oidc-common.

View the commit online:
http://git.shibboleth.net/view/?p=java-oidc-common.git;a=commit;h=cd2e3755c5b0971c2fc225b228f4d1a6e00c8c9f

The following commit(s) were added to refs/heads/main by this push:
     new cd2e375  Fix Javadoc and identifier naming
cd2e375 is described below

commit cd2e3755c5b0971c2fc225b228f4d1a6e00c8c9f
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Mar 9 09:12:20 2022 +0000

    Fix Javadoc and identifier naming
---
 .../impl/MetadataPolicyLookupStrategyFactory.java      | 18 +++++++++---------
 .../metadata-policy-lookup-strategy-factory-test.xml   |  4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/oidc-common-metadata-impl/src/main/java/net/shibboleth/oidc/metadata/cache/impl/MetadataPolicyLookupStrategyFactory.java b/oidc-common-metadata-impl/src/main/java/net/shibboleth/oidc/metadata/cache/impl/MetadataPolicyLookupStrategyFactory.java
index dc16cc3..4f4a852 100644
--- a/oidc-common-metadata-impl/src/main/java/net/shibboleth/oidc/metadata/cache/impl/MetadataPolicyLookupStrategyFactory.java
+++ b/oidc-common-metadata-impl/src/main/java/net/shibboleth/oidc/metadata/cache/impl/MetadataPolicyLookupStrategyFactory.java
@@ -6,11 +6,11 @@ import java.util.function.Function;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
+import javax.annotation.concurrent.ThreadSafe;
 
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.springframework.core.io.Resource;
 
-import net.shibboleth.oidc.metadata.cache.LoadingStrategy;
 import net.shibboleth.oidc.metadata.policy.MetadataPolicy;
 import net.shibboleth.oidc.metadata.policy.MetadataPolicyResolver;
 import net.shibboleth.oidc.metadata.policy.impl.OIDCMetadataPolicyResolver;
@@ -20,12 +20,12 @@ import net.shibboleth.utilities.java.support.component.ComponentInitializationEx
 import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
 
 /**
- * A factory for building a {@link BatchMetadataCache} which uses a File based {@link LoadingStrategy} with the supplied
- * file resource. Adds the cache to a new {@link MetadataPolicyResolver} instance. In this sense, every invocation of 
- * the builder will produce a new cache inside a new resolver. ADD TYO
- * 
- * <p>Not thread-safe, should be a prototype factory.</p>
+ * A factory for building a function that resolves maps of metadata policies from the profile request context. The
+ * function uses a newly created {@link MetadataPolicyResolver}. The resolver is backed by a newly instantiated
+ * {@link BatchMetadataCache}. Every invocation of this factory will therefore build a new resolver and cache instance
+ * from the supplied cache specification.
  */
+ at ThreadSafe
 public class MetadataPolicyLookupStrategyFactory {
     
 
@@ -48,19 +48,19 @@ public class MetadataPolicyLookupStrategyFactory {
             @ParameterName(name="resource") @Nonnull final Resource file,
             @ParameterName(name="cacheSpec") @Nonnull final BatchMetadataCacheBuilderSpec<String, Map<String, MetadataPolicy>> spec,
             @ParameterName(name="criteriaSetLookupStrategy") @Nullable final Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy,
-            @ParameterName(name="cacheId") @Nonnull final String cacheId) throws ComponentInitializationException, IOException{
+            @ParameterName(name="id") @Nonnull final String id) throws ComponentInitializationException, IOException{
         
         final BatchMetadataCacheBuilder.Builder<String, Map<String, MetadataPolicy>> builder = 
                 new BatchMetadataCacheBuilder.Builder<>();
         
         final DefaultFileLoadingStrategy fileStrategy = new DefaultFileLoadingStrategy(file);
         spec.setLoadingStrategy(fileStrategy);
-        spec.setCacheId(cacheId);
+        spec.setCacheId(id + "-cache");
 
         final BatchMetadataCache<String, Map<String, MetadataPolicy>> cache = builder.build(spec);
         
         final OIDCMetadataPolicyResolver resolver = new OIDCMetadataPolicyResolver(cache);
-        resolver.setId(cacheId + "-resolver");
+        resolver.setId(id + "-resolver");
         resolver.initialize();
         
         final ResolverBasedRegistrationMetadataPolicyLookupFunction function = 
diff --git a/oidc-common-metadata-impl/src/test/resources/net/shibboleth/oidc/metadata/impl/metadata-policy-lookup-strategy-factory-test.xml b/oidc-common-metadata-impl/src/test/resources/net/shibboleth/oidc/metadata/impl/metadata-policy-lookup-strategy-factory-test.xml
index 75e832f..f9d8e43 100644
--- a/oidc-common-metadata-impl/src/test/resources/net/shibboleth/oidc/metadata/impl/metadata-policy-lookup-strategy-factory-test.xml
+++ b/oidc-common-metadata-impl/src/test/resources/net/shibboleth/oidc/metadata/impl/metadata-policy-lookup-strategy-factory-test.xml
@@ -51,12 +51,12 @@
     <bean id="shibboleth.oidc.test.MetadataPolicyLookupStrategyOne"
         parent="shibboleth.oidc.test.MetadataPolicyLookupStrategy"
         c:_0="classpath:net/shibboleth/oidc/metadata/impl/metadata-policy-lookup-strategy-factory-test-dummy-file.txt"       
-        c:cacheId="StrategyCache" />
+        c:id="PolicyOne" />
 
     <bean id="shibboleth.oidc.test.MetadataPolicyLookupStrategyTwo"
         parent="shibboleth.oidc.test.MetadataPolicyLookupStrategy"
         c:_0="classpath:net/shibboleth/oidc/metadata/impl/metadata-policy-lookup-strategy-factory-test-dummy-file.txt"
-        c:cacheId="StrategyTwoCache" />
+        c:id="PolicyTwo" />
 
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list