Class MetadataPolicyViaLocationFetchingStrategy
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.oidc.metadata.impl.AbstractDynamicHTTPFetchingStrategy<Map<String,MetadataPolicy>>
net.shibboleth.oidc.metadata.policy.impl.MetadataPolicyViaLocationFetchingStrategy
- All Implemented Interfaces:
Function<CriteriaSet,,Map<String, MetadataPolicy>> Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
public class MetadataPolicyViaLocationFetchingStrategy
extends AbstractDynamicHTTPFetchingStrategy<Map<String,MetadataPolicy>>
implements Function<CriteriaSet,Map<String,MetadataPolicy>>
A fetching strategy that exploits
ResourceLocationCriterion from the given CriteriaSet to resolve
a location for metadata policy. If the value starts with http:// or https://, the policy
is fetched via HttpClient. In other cases the location is expected to be a file path. Possibly existing
file: prefix is removed before loading the file.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private Function<byte[],List<Map<String, MetadataPolicy>>> The parsing strategy used for parsing metadata policies.Fields inherited from class net.shibboleth.oidc.metadata.impl.AbstractDynamicHTTPFetchingStrategy
MDC_ATTRIB_CURRENT_REQUEST_URI -
Constructor Summary
ConstructorsConstructorDescriptionMetadataPolicyViaLocationFetchingStrategy(org.apache.hc.client5.http.classic.HttpClient client, org.apache.hc.core5.http.io.HttpClientResponseHandler<Map<String, MetadataPolicy>> handler) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionapply(CriteriaSet criteriaSet) protected StringbuildRequestURL(CriteriaSet criteria) Build the request URL based on the input criteria set.protected voidvoidsetParsingStrategy(Function<byte[], List<Map<String, MetadataPolicy>>> strategy) Set the parsing strategy used for parsing metadata policies.Methods inherited from class net.shibboleth.oidc.metadata.impl.AbstractDynamicHTTPFetchingStrategy
getSupportedContentTypes, setHttpClientSecurityParameters, setSupportedContentTypesMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
parsingStrategy
The parsing strategy used for parsing metadata policies.
-
-
Constructor Details
-
MetadataPolicyViaLocationFetchingStrategy
public MetadataPolicyViaLocationFetchingStrategy(@Nonnull org.apache.hc.client5.http.classic.HttpClient client, @Nonnull org.apache.hc.core5.http.io.HttpClientResponseHandler<Map<String, MetadataPolicy>> handler) Constructor.- Parameters:
client- the instance ofHttpClientused to fetch remote metadata policy.handler- the response handler used to convert the HTTP response to the metadata policy.
-
-
Method Details
-
setParsingStrategy
Set the parsing strategy used for parsing metadata policies.- Parameters:
strategy- What to set.
-
doInitialize
- Overrides:
doInitializein classAbstractDynamicHTTPFetchingStrategy<Map<String,MetadataPolicy>> - Throws:
ComponentInitializationException
-