public class TemplateRequestURLBuilder
extends java.lang.Object
implements com.google.common.base.Function<java.lang.String,java.lang.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 java.lang.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 java.lang.String |
templateText
The template text, for logging purposes.
|
private com.google.common.base.Function<java.lang.String,java.lang.String> |
transformer
Function which transforms the entityID prior to substitution into the template.
|
| Constructor and Description |
|---|
TemplateRequestURLBuilder(org.apache.velocity.app.VelocityEngine engine,
java.lang.String templateString,
boolean encoded)
Constructor.
|
TemplateRequestURLBuilder(org.apache.velocity.app.VelocityEngine engine,
java.lang.String templateString,
boolean encoded,
com.google.common.base.Function<java.lang.String,java.lang.String> transform)
Constructor.
|
TemplateRequestURLBuilder(org.apache.velocity.app.VelocityEngine engine,
java.lang.String templateString,
boolean encoded,
com.google.common.base.Function<java.lang.String,java.lang.String> transform,
java.nio.charset.Charset charSet)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
apply(java.lang.String input) |
public static final java.lang.String CONTEXT_KEY_ENTITY_ID
private final org.slf4j.Logger log
private net.shibboleth.utilities.java.support.velocity.Template template
private java.lang.String templateText
private com.google.common.base.Function<java.lang.String,java.lang.String> transformer
private boolean encodeEntityID
public TemplateRequestURLBuilder(@Nonnull
org.apache.velocity.app.VelocityEngine engine,
@Nonnull @NotEmpty
java.lang.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
java.lang.String templateString,
boolean encoded,
@Nullable
com.google.common.base.Function<java.lang.String,java.lang.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
java.lang.String templateString,
boolean encoded,
@Nullable
com.google.common.base.Function<java.lang.String,java.lang.String> transform,
@Nullable
java.nio.charset.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 null