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 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() |
String |
getBindingURI() |
protected 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.
|
String |
getVelocityTemplateId()
Get the Velocity template id.
|
protected 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,
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,
String endpointURL) |
void |
setVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine)
Set the VelocityEngine instance.
|
void |
setVelocityTemplateId(String newVelocityTemplateId)
Set the Velocity template id.
|
encode, getMessageContext, prepareContext, setMessageContext
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final String DEFAULT_TEMPLATE_ID
public Pac4jHTTPPostEncoder(Pac4jSAMLResponse responseAdapter)
public void setVelocityTemplateId(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.ComponentInitializationException
protected 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.MessageEncodingException
protected 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, String endpointURL) throws org.opensaml.messaging.encoder.MessageEncodingException
org.opensaml.messaging.encoder.MessageEncodingException
public 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, 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 String getBindingURI()
protected 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 © 2017. All rights reserved.