Class MetadataPolicyLookupStrategyFactory
java.lang.Object
net.shibboleth.oidc.metadata.cache.impl.MetadataPolicyLookupStrategyFactory
A factory for building a function that resolves maps of metadata policies from the profile request context. The
function uses a newly created
MetadataPolicyResolver. The resolver is backed by a newly instantiated
BatchMetadataCache. Every invocation of this factory will therefore build a new resolver and cache instance
from the supplied cache specification.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildFileLoadingMetadataPolicyResolver(String resource, BatchMetadataCacheBuilderSpec<String, Map<String, MetadataPolicy>> cacheSpec, Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, String id) Build a Function that maps a profile request context to a map of metadata policies.buildFileLoadingMetadataPolicyResolver(String resource, BatchMetadataCacheBuilderSpec<String, Map<String, MetadataPolicy>> cacheSpec, Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, String id, String defaultContents) Build a Function that maps a profile request context to a map of metadata policies.protected Function<ProfileRequestContext,Map<String, MetadataPolicy>> buildMetadataPolicyResolver(LoadingStrategy loadingStrategy, BatchMetadataCacheBuilderSpec<String, Map<String, MetadataPolicy>> cacheSpec, Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, String id) Build a Function that maps a profile request context to a map of metadata policies.buildResourceLoadingMetadataPolicyResolver(Resource resource, BatchMetadataCacheBuilderSpec<String, Map<String, MetadataPolicy>> cacheSpec, Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, String id) Build a Function that maps a profile request context to a map of metadata policies.
-
Constructor Details
-
MetadataPolicyLookupStrategyFactory
public MetadataPolicyLookupStrategyFactory()
-
-
Method Details
-
buildFileLoadingMetadataPolicyResolver
@Nonnull public Function<ProfileRequestContext,Map<String, buildFileLoadingMetadataPolicyResolverMetadataPolicy>> (@ParameterName(name="resource") @Nullable String resource, @ParameterName(name="cacheSpec") @Nonnull BatchMetadataCacheBuilderSpec<String, Map<String, throws ComponentInitializationException, IOExceptionMetadataPolicy>> cacheSpec, @ParameterName(name="criteriaSetLookupStrategy") @Nullable Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, @ParameterName(name="id") @Nonnull String id) Build a Function that maps a profile request context to a map of metadata policies. The map is resolved from a newly instantiatedMetadataPolicyResolver. The Resolver calls a newBatchMetadataCachewhich is hard-wired to use a default file loading strategy with the file resource supplied.- Parameters:
resource- the file to inject into the loading strategy. Can be null or empty.cacheSpec- the metadata cache specificationcriteriaSetLookupStrategy- the lookup strategy for the criteria set used for the metadata policy resolver.id- the identifier/name for the back-end cache created- Returns:
- the function
- Throws:
ComponentInitializationException- on error.IOException- on error.
-
buildFileLoadingMetadataPolicyResolver
@Nonnull public Function<ProfileRequestContext,Map<String, buildFileLoadingMetadataPolicyResolverMetadataPolicy>> (@ParameterName(name="resource") @Nullable String resource, @ParameterName(name="cacheSpec") @Nonnull BatchMetadataCacheBuilderSpec<String, Map<String, throws ComponentInitializationException, IOExceptionMetadataPolicy>> cacheSpec, @ParameterName(name="criteriaSetLookupStrategy") @Nullable Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, @ParameterName(name="id") @Nonnull String id, @ParameterName(name="defaultContents") @Nullable String defaultContents) Build a Function that maps a profile request context to a map of metadata policies. The map is resolved from a newly instantiatedMetadataPolicyResolver. The Resolver calls a newBatchMetadataCachewhich is hard-wired to use a default file loading strategy with the file resource supplied.- Parameters:
resource- the file to inject into the loading strategy. Can be null or empty.cacheSpec- the metadata cache specificationcriteriaSetLookupStrategy- the lookup strategy for the criteria set used for the metadata policy resolver.id- the identifier/name for the back-end cache createddefaultContents- the default contents for the resource if resource was null or empty.- Returns:
- the function
- Throws:
ComponentInitializationException- on error.IOException- on error.- Since:
- 3.1.0
-
buildResourceLoadingMetadataPolicyResolver
@Nonnull public Function<ProfileRequestContext,Map<String, buildResourceLoadingMetadataPolicyResolverMetadataPolicy>> (@ParameterName(name="resource") @Nullable Resource resource, @ParameterName(name="cacheSpec") @Nonnull BatchMetadataCacheBuilderSpec<String, Map<String, throws ComponentInitializationException, IOExceptionMetadataPolicy>> cacheSpec, @ParameterName(name="criteriaSetLookupStrategy") @Nullable Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, @ParameterName(name="id") @Nonnull String id) Build a Function that maps a profile request context to a map of metadata policies. The map is resolved from a newly instantiatedMetadataPolicyResolver. The Resolver calls a newBatchMetadataCachewhich is hard-wired to use a default file loading strategy with the file resource supplied.- Parameters:
resource- the resource to inject into the loading strategy. Can be null or empty.cacheSpec- the metadata cache specificationcriteriaSetLookupStrategy- the lookup strategy for the criteria set used for the metadata policy resolver.id- the identifier/name for the back-end cache created- Returns:
- the function
- Throws:
ComponentInitializationException- on error.IOException- on error.- Since:
- 3.1.0
-
buildMetadataPolicyResolver
@Nonnull protected Function<ProfileRequestContext,Map<String, buildMetadataPolicyResolverMetadataPolicy>> (@Nonnull LoadingStrategy loadingStrategy, @Nonnull BatchMetadataCacheBuilderSpec<String, Map<String, throws ComponentInitializationException, IOExceptionMetadataPolicy>> cacheSpec, @Nullable Function<ProfileRequestContext, CriteriaSet> criteriaSetLookupStrategy, @Nonnull String id) Build a Function that maps a profile request context to a map of metadata policies. The map is resolved from a newly instantiatedMetadataPolicyResolver. The Resolver calls a newBatchMetadataCachewhich is hard-wired to use a default file loading strategy with the file resource supplied.- Parameters:
loadingStrategy- the loading strategy containing the metadata resource.cacheSpec- the metadata cache specificationcriteriaSetLookupStrategy- the lookup strategy for the criteria set used for the metadata policy resolver.id- the identifier/name for the back-end cache created- Returns:
- the function
- Throws:
ComponentInitializationException- on error.IOException- on error.
-