Class MetadataQueryProtocolRequestURLBuilder
java.lang.Object
org.opensaml.saml.metadata.resolver.impl.MetadataQueryProtocolRequestURLBuilder
- All Implemented Interfaces:
Function<CriteriaSet,String>
public class MetadataQueryProtocolRequestURLBuilder
extends Object
implements Function<CriteriaSet,String>
Function which produces a URL according to the Metadata Query Protocol (MDQ) specification.
Support for building request URLs per the MDQ SAML profile based on an EntityIdCriterion is built-in.
Support for building request URLs via other criteria may be specified via ordered instances
of MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder. These are evaluated in the supplied order,
and the first non-null result will be returned.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for a component which builds a Metadata Query Protocol request URL from a base URL and criteria. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe request base URL per the specification.private final org.slf4j.LoggerLogger.private final EscaperPath escaper for escaping the input value inserted into the URL path.Function which transforms the entityID prior to substitution into the URL.List of secondary URL builders. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.MetadataQueryProtocolRequestURLBuilder(String baseURL, Function<String, String> transform) Constructor.MetadataQueryProtocolRequestURLBuilder(String baseURL, Function<String, String> transform, List<MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder> secondaryURLBuilders) Constructor.MetadataQueryProtocolRequestURLBuilder(String baseURL, List<MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder> secondaryURLBuilders) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionapply(CriteriaSet criteria) private StringbuildFromEntityID(String inputEntityID) Build request URL from entityID.private StringbuildFromSecondaryLookups(CriteriaSet criteria) Build request URL from secondary lookup criteria.Gets the base URL configured into function.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logLogger. -
base
The request base URL per the specification. -
transformer
Function which transforms the entityID prior to substitution into the URL. -
pathEscaper
Path escaper for escaping the input value inserted into the URL path. -
urlBuilders
@Nullable private List<MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder> urlBuildersList of secondary URL builders.
-
-
Constructor Details
-
MetadataQueryProtocolRequestURLBuilder
public MetadataQueryProtocolRequestURLBuilder(@ParameterName(name="baseURL") @Nonnull @NotEmpty String baseURL) Constructor.- Parameters:
baseURL- the base URL for the metadata responder
-
MetadataQueryProtocolRequestURLBuilder
public MetadataQueryProtocolRequestURLBuilder(@ParameterName(name="baseURL") @Nonnull @NotEmpty String baseURL, @ParameterName(name="transform") @Nullable Function<String, String> transform) Constructor.- Parameters:
baseURL- the base URL for the metadata respondertransform- function which transforms the entityID prior to URL construction substitution, may be null
-
MetadataQueryProtocolRequestURLBuilder
public MetadataQueryProtocolRequestURLBuilder(@ParameterName(name="baseURL") @Nonnull @NotEmpty String baseURL, @ParameterName(name="secondaryURLBuilders") @Nullable List<MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder> secondaryURLBuilders) Constructor.- Parameters:
baseURL- the base URL for the metadata respondersecondaryURLBuilders- the list of secondary URL builders, may be null
-
MetadataQueryProtocolRequestURLBuilder
public MetadataQueryProtocolRequestURLBuilder(@ParameterName(name="baseURL") @Nonnull @NotEmpty String baseURL, @ParameterName(name="transform") @Nullable Function<String, String> transform, @ParameterName(name="secondaryURLBuilders") @Nullable List<MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder> secondaryURLBuilders) Constructor.- Parameters:
baseURL- the base URL for the metadata respondertransform- function which transforms the entityID prior to URL construction substitution, may be nullsecondaryURLBuilders- the list of secondary URL builders, may be null
-
-
Method Details
-
getBaseURL
Gets the base URL configured into function.- Returns:
- base URL
- Since:
- 5.0.0
-
buildFromEntityID
Build request URL from entityID.- Parameters:
inputEntityID- the entityID- Returns:
- the request URL, or null
-