Package org.opensaml.saml.metadata.generator.impl

# Class AbstractEndpointConverter<T extends Endpoint>

java.lang.Object
org.opensaml.saml.metadata.generator.impl.AbstractEndpointConverter<T>

Type Parameters:
  `T` - endpoint type

All Implemented Interfaces:
  `BiFunction<String,List<String>,T>`

Direct Known Subclasses:
  `ArtifactResolutionServiceConverter`, `AssertionConsumerServiceConverter`, `AttributeServiceConverter`, `SingleLogoutServiceConverter`, `SingleSignOnServiceConverter`

public abstract class AbstractEndpointConverter<T extends Endpoint> extends Object implements BiFunction<String,List<String>,T>
Support for parsing a binding/endpoint pair into an endpoint of a particular type.

The input format is a binding token, forward slash, and an endpoint. The endpoint MAY omit the scheme, in which case 'https://' is prepended.

The SAML 2.0 bindings are represented by the tokens "Redirect", "POST", "SimpleSign", "Artifact", "SOAP", and "PAOS".

The SAML 1.1 bindings are represented by the tokens "Redirect1", "POST1", "Artifact1", and "SOAP1". The first token is actually the proprietary Shibboleth request protocol.

The second input parameter is mutated to maintain the list of protocols applicable to the surrounding role.

Since:
  5.0.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private static Map<String,Pair<String,String>>`
`bindingMap`
Map of binding shortcuts to constants.
`private final SAMLObjectBuilder<T>`
`builder`
Object builder.

## Constructor Summary

Constructors
Constructor
Description
`AbstractEndpointConverter(SAMLObjectBuilder<T> theBuilder)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static void`
`addBinding(String token, String protocol, String binding)`
Add a new mapping to the static set of protocol/binding mappings.
`protected String`
`getLocation(String input)`
Parse out the endpoint location.
`protected T`
`getProcessedEndpoint(List<String> protocols, String input)`
Process an endpoint expression into an absolute URL.
`protected Pair<String,String>`
`getProtocolAndBinding(String input)`
Parse out the binding shortcut and map to a protocol and binding constant.

### 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.BiFunction

`andThen, apply`

## Field Details

### bindingMap

@Nonnull private static Map<String,Pair<String,String>> bindingMap
Map of binding shortcuts to constants.

### builder

@Nonnull private final SAMLObjectBuilder<T extends Endpoint> builder
Object builder.

## Constructor Details

### AbstractEndpointConverter

public AbstractEndpointConverter(@Nonnull SAMLObjectBuilder<T> theBuilder)
Constructor.

Parameters:
  `theBuilder` - builder to use

## Method Details

### getProcessedEndpoint

@Nonnull protected T getProcessedEndpoint(@Nullable @Live List<String> protocols, @Nullable String input)
Process an endpoint expression into an absolute URL.

For now, this merely detects the http schemes and if absent, adds the https scheme.

Parameters:
  `protocols` - live list of protocol strings
  `input` - the argument
Returns:
  the endpoint object

### getProtocolAndBinding

@Nonnull protected Pair<String,String> getProtocolAndBinding(@Nonnull String input)
Parse out the binding shortcut and map to a protocol and binding constant.

Parameters:
  `input` - the argument
Returns:
  the mapped constant

### getLocation

@Nonnull protected String getLocation(@Nonnull String input)
Parse out the endpoint location.

Parameters:
  `input` - the argument
Returns:
  the endpoint location

### addBinding

public static void addBinding(@Nonnull String token, @Nonnull String protocol, @Nonnull String binding)
Add a new mapping to the static set of protocol/binding mappings.

Parameters:
  `token` - token used in strings converted into endpoints
  `protocol` - protocol support string for binding
  `binding` - binding constant