Package org.opensaml.saml.metadata.resolver.impl

# 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 Classes
Modifier and Type
Class
Description
`static interface`
`MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder`
Interface for a component which builds a Metadata Query Protocol request URL from a base URL and criteria.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`base`
The request base URL per the specification.
`private final org.slf4j.Logger`
`log`
Logger.
`private final Escaper`
`pathEscaper`
Path escaper for escaping the input value inserted into the URL path.
`private Function<String,String>`
`transformer`
Function which transforms the entityID prior to substitution into the URL.
`private List<MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder>`
`urlBuilders`
List of secondary URL builders.

## Constructor Summary

Constructors
Constructor
Description
`MetadataQueryProtocolRequestURLBuilder(String baseURL)`
Constructor.
`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 Type
Method
Description
`String`
`apply(CriteriaSet criteria)`
`private String`
`buildFromEntityID(String inputEntityID)`
Build request URL from entityID.
`private String`
`buildFromSecondaryLookups(CriteriaSet criteria)`
Build request URL from secondary lookup criteria.
`String`
`getBaseURL()`
Gets the base URL configured into function.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Function

`andThen, compose`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Logger.

### base

@Nonnull @NotEmpty private String base
The request base URL per the specification.

### transformer

@Nullable private Function<String,String> transformer
Function which transforms the entityID prior to substitution into the URL.

### pathEscaper

@Nonnull private final Escaper pathEscaper
Path escaper for escaping the input value inserted into the URL path.

### urlBuilders

@Nullable private List<MetadataQueryProtocolRequestURLBuilder.MetadataQueryProtocolURLBuilder> urlBuilders
List 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 responder
  `transform` - 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 responder
  `secondaryURLBuilders` - 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 responder
  `transform` - function which transforms the entityID prior to URL construction substitution, may be null
  `secondaryURLBuilders` - the list of secondary URL builders, may be null

## Method Details

### getBaseURL

@Nonnull @NotEmpty public String getBaseURL()
Gets the base URL configured into function.

Returns:
  base URL
Since:
  5.0.0

### apply

@Nullable public String apply(@Nullable CriteriaSet criteria)

Specified by:
  `apply` in interface `Function<CriteriaSet,String>`

### buildFromEntityID

@Nullable private String buildFromEntityID(@Nonnull String inputEntityID)
Build request URL from entityID.

Parameters:
  `inputEntityID` - the entityID
Returns:
  the request URL, or null

### buildFromSecondaryLookups

@Nullable private String buildFromSecondaryLookups(@Nullable CriteriaSet criteria)
Build request URL from secondary lookup criteria.

Parameters:
  `criteria` - the criteria
Returns:
  the request URL, or null