public class TemplateRequestURLBuilder extends Object implements com.google.common.base.Function<String,String>
The entity ID will be replaced in the template string according to the template variable entityID
,
e.g. "https://metadataservice.com/entity/${entityID}".
If the value of the encoded
parameter is true
then the entity ID will be URL encoded prior
to substitution. Otherwise, the literal value of the entity ID will be substituted.
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_KEY_ENTITY_ID
The Velocity context variable name for the entity ID.
|
private boolean |
encodeEntityID
Flag indicating whether to URL-encode the entity ID value before substitution.
|
private org.slf4j.Logger |
log
Logger.
|
private net.shibboleth.utilities.java.support.velocity.Template |
template
Velocity template instance used to render the request URL.
|
private String |
templateText
The template text, for logging purposes.
|
private com.google.common.base.Function<String,String> |
transformer
Function which transforms the entityID prior to substitution into the template.
|
Constructor and Description |
---|
TemplateRequestURLBuilder(org.apache.velocity.app.VelocityEngine engine,
String templateString,
boolean encoded)
Constructor.
|
TemplateRequestURLBuilder(org.apache.velocity.app.VelocityEngine engine,
String templateString,
boolean encoded,
com.google.common.base.Function<String,String> transform)
Constructor.
|
TemplateRequestURLBuilder(org.apache.velocity.app.VelocityEngine engine,
String templateString,
boolean encoded,
com.google.common.base.Function<String,String> transform,
Charset charSet)
Constructor.
|
public static final String CONTEXT_KEY_ENTITY_ID
private final org.slf4j.Logger log
private net.shibboleth.utilities.java.support.velocity.Template template
private String templateText
private com.google.common.base.Function<String,String> transformer
private boolean encodeEntityID
public TemplateRequestURLBuilder(@Nonnull org.apache.velocity.app.VelocityEngine engine, @Nonnull @NotEmpty String templateString, boolean encoded)
The template character set will be US ASCII.
engine
- the VelocityEngine
instance to usetemplateString
- the Velocity template stringencoded
- true if entity ID should be URL-encoded prior to substitution, false otherwisepublic TemplateRequestURLBuilder(@Nonnull org.apache.velocity.app.VelocityEngine engine, @Nonnull @NotEmpty String templateString, boolean encoded, @Nullable com.google.common.base.Function<String,String> transform)
The template character set will be US ASCII.
engine
- the VelocityEngine
instance to usetemplateString
- the Velocity template stringtransform
- function which transforms the entityID prior to substitution, may be nullencoded
- true if entity ID should be URL-encoded prior to substitution, false otherwisepublic TemplateRequestURLBuilder(@Nonnull org.apache.velocity.app.VelocityEngine engine, @Nonnull @NotEmpty String templateString, boolean encoded, @Nullable com.google.common.base.Function<String,String> transform, @Nullable Charset charSet)
engine
- the VelocityEngine
instance to usetemplateString
- the Velocity template stringencoded
- true if entity ID should be URL-encoded prior to substitution, false otherwisetransform
- function which transforms the entityID prior to substitution, may be nullcharSet
- character set of the template, may be nullCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.