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 Details

  • 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