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
FieldsModifier and TypeFieldDescriptionMap of binding shortcuts to constants.private final SAMLObjectBuilder<T>Object builder. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBinding(String token, String protocol, String binding) Add a new mapping to the static set of protocol/binding mappings.protected StringgetLocation(String input) Parse out the endpoint location.protected TgetProcessedEndpoint(List<String> protocols, String input) Process an endpoint expression into an absolute URL.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, waitMethods inherited from interface java.util.function.BiFunction
andThen, apply
-
Field Details
-
bindingMap
Map of binding shortcuts to constants. -
builder
Object builder.
-
-
Constructor Details
-
AbstractEndpointConverter
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 stringsinput- the argument- Returns:
- the endpoint object
-
getProtocolAndBinding
Parse out the binding shortcut and map to a protocol and binding constant.- Parameters:
input- the argument- Returns:
- the mapped constant
-
getLocation
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 endpointsprotocol- protocol support string for bindingbinding- binding constant
-