Package net.shibboleth.spring.metadata

# Class HTTPMetadataProvidersParserSupport

java.lang.Object
net.shibboleth.spring.metadata.HTTPMetadataProvidersParserSupport

public final class HTTPMetadataProvidersParserSupport extends Object
Helper class for Spring configuration of HTTP metadata providers.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final org.slf4j.Logger`
`LOG`
Class logger.
`static final String`
`METADATA_URL`
The URL for the metadata.
`static final QName`
`TLS_TRUST_ENGINE_ELEMENT_NAME`
TLSTrustEngine element name.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`HTTPMetadataProvidersParserSupport()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected static BeanDefinitionBuilder`
`buildCommonClientBuilder(Element element, ParserContext parserContext, Class<?> clientBuildClass, BeanDefinition httpClientSecurityParameters)`
Build a `BeanDefinitionBuilder` for a `HttpClientFactoryBean` and populate it from the "standard" attributes which are shared between the Dynamic and Static providers.
`protected static BeanDefinition`
`buildHttpClientSecurityParameters(Element tlsTrustEngine, String parametersRef, ParserContext parserContext)`
Build the definition of the HttpClientSecurityParameters as a factory bean which merges the inline TLS TrustEngine and parameters ref inputs.
`protected static BeanDefinition`
`buildTLSSocketFactory(Element element, ParserContext parserContext, BeanDefinition httpClientSecurityParameters)`
Build the definition of the HTTPClientBuilder which contains all our configuration.
`protected static BeanDefinition`
`parseTLSTrustEngine(Element tlsTrustEngine, ParserContext parserContext)`
Build the BeanDefinition of the `HttpClientSecurityParameters` which contains the TLS trust engine provided.

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

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

## Field Details

### METADATA_URL

@Nonnull @NotEmpty public static final String METADATA_URL
The URL for the metadata.

See Also:
  - Constant Field Values

### TLS_TRUST_ENGINE_ELEMENT_NAME

@Nonnull public static final QName TLS_TRUST_ENGINE_ELEMENT_NAME
TLSTrustEngine element name.

### LOG

@Nonnull private static final org.slf4j.Logger LOG
Class logger.

## Constructor Details

### HTTPMetadataProvidersParserSupport

private HTTPMetadataProvidersParserSupport()
Constructor.

## Method Details

### buildHttpClientSecurityParameters

@Nonnull protected static BeanDefinition buildHttpClientSecurityParameters(@Nullable Element tlsTrustEngine, @Nullable String parametersRef, @Nonnull ParserContext parserContext)
Build the definition of the HttpClientSecurityParameters as a factory bean which merges the inline TLS TrustEngine and parameters ref inputs.

Parameters:
  `tlsTrustEngine` - the element defining the inline TLS TrustEngine
  `parametersRef` - the security parameters bean reference
  `parserContext` - context
Returns:
  the bean definition with the parameters.

### buildTLSSocketFactory

@Nonnull protected static BeanDefinition buildTLSSocketFactory(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nullable BeanDefinition httpClientSecurityParameters)
Build the definition of the HTTPClientBuilder which contains all our configuration.

Parameters:
  `element` - the HTTPMetadataProvider parser.
  `parserContext` - context
  `httpClientSecurityParameters` - a bean definition
Returns:
  the bean definition with the parameters.

### parseTLSTrustEngine

@Nullable protected static BeanDefinition parseTLSTrustEngine(@Nullable Element tlsTrustEngine, @Nonnull ParserContext parserContext)
Build the BeanDefinition of the `HttpClientSecurityParameters` which contains the TLS trust engine provided.

One of the first two parameters must be non-null.

Parameters:
  `tlsTrustEngine` - if present, the TLSTrustEngine element
  `parserContext` - context
Returns:
  the bean definition

### buildCommonClientBuilder

@Nonnull protected static BeanDefinitionBuilder buildCommonClientBuilder(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull Class<?> clientBuildClass, @Nullable BeanDefinition httpClientSecurityParameters)
Build a `BeanDefinitionBuilder` for a `HttpClientFactoryBean` and populate it from the "standard" attributes which are shared between the Dynamic and Static providers. non standard defaults are applied by the caller.

Parameters:
  `element` - the configuration
  `parserContext` - context
  `clientBuildClass` - the type of builder to create.
  `httpClientSecurityParameters` - the client security parameters to be used
Returns:
  an appropriate builder