public class Pac4jHTTPPostEncoder
extends org.opensaml.messaging.encoder.AbstractMessageEncoder<org.opensaml.saml.common.SAMLObject>
AbstractMessageEncoder as intermediate classes use the J2E HTTP response.
It's mostly a copy/paste of the source code of these intermediate opensaml classes.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TEMPLATE_ID
Default template ID.
|
| Constructor and Description |
|---|
Pac4jHTTPPostEncoder(Pac4jSAMLResponse responseAdapter) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doEncode() |
protected void |
doInitialize() |
java.lang.String |
getBindingURI() |
protected java.net.URI |
getEndpointURL(org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext)
Gets the response URL from the message context.
|
org.apache.velocity.app.VelocityEngine |
getVelocityEngine()
Get the VelocityEngine instance.
|
java.lang.String |
getVelocityTemplateId()
Get the Velocity template id.
|
protected org.w3c.dom.Element |
marshallMessage(org.opensaml.core.xml.XMLObject message)
Helper method that marshalls the given message.
|
protected void |
populateVelocityContext(org.apache.velocity.VelocityContext velocityContext,
org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext,
java.lang.String endpointURL)
Populate the Velocity context instance which will be used to render the POST body.
|
protected void |
postEncode(org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext,
java.lang.String endpointURL) |
void |
setVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine)
Set the VelocityEngine instance.
|
void |
setVelocityTemplateId(java.lang.String newVelocityTemplateId)
Set the Velocity template id.
|
encode, getMessageContext, prepareContext, setMessageContextdestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final java.lang.String DEFAULT_TEMPLATE_ID
public Pac4jHTTPPostEncoder(Pac4jSAMLResponse responseAdapter)
public void setVelocityTemplateId(java.lang.String newVelocityTemplateId)
Defaults to DEFAULT_TEMPLATE_ID.
newVelocityTemplateId - the new Velocity template idprotected void doDestroy()
doDestroy in class org.opensaml.messaging.encoder.AbstractMessageEncoder<org.opensaml.saml.common.SAMLObject>protected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class org.opensaml.messaging.encoder.AbstractMessageEncoder<org.opensaml.saml.common.SAMLObject>net.shibboleth.utilities.java.support.component.ComponentInitializationExceptionprotected void doEncode()
throws org.opensaml.messaging.encoder.MessageEncodingException
doEncode in class org.opensaml.messaging.encoder.AbstractMessageEncoder<org.opensaml.saml.common.SAMLObject>org.opensaml.messaging.encoder.MessageEncodingExceptionprotected java.net.URI getEndpointURL(org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext)
throws org.opensaml.messaging.encoder.MessageEncodingException
messageContext - current message contextorg.opensaml.messaging.encoder.MessageEncodingException - throw if no relying party endpoint is availableprotected void postEncode(org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext,
java.lang.String endpointURL)
throws org.opensaml.messaging.encoder.MessageEncodingException
org.opensaml.messaging.encoder.MessageEncodingExceptionpublic java.lang.String getVelocityTemplateId()
Defaults to DEFAULT_TEMPLATE_ID.
public org.apache.velocity.app.VelocityEngine getVelocityEngine()
protected void populateVelocityContext(org.apache.velocity.VelocityContext velocityContext,
org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext,
java.lang.String endpointURL)
throws org.opensaml.messaging.encoder.MessageEncodingException
velocityContext - the Velocity context instance to populate with datamessageContext - the SAML message context source of dataendpointURL - endpoint URL to which to encode messageorg.opensaml.messaging.encoder.MessageEncodingException - thrown if there is a problem encoding the messagepublic void setVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine)
newVelocityEngine - the new VelocityEngine instanepublic java.lang.String getBindingURI()
protected org.w3c.dom.Element marshallMessage(org.opensaml.core.xml.XMLObject message)
throws org.opensaml.messaging.encoder.MessageEncodingException
message - message the marshall and serializeorg.opensaml.messaging.encoder.MessageEncodingException - thrown if the give message can not be marshalled into its DOM representationCopyright © 2019. All Rights Reserved.