Class HTTPPostEncoder
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder
org.opensaml.saml.saml1.binding.encoding.impl.BaseSAML1MessageEncoder
org.opensaml.saml.saml1.binding.encoding.impl.HTTPPostEncoder
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,UnmodifiableComponent
,MessageEncoder
,HttpServletResponseMessageEncoder
,SAMLMessageEncoder
SAML 1.X HTTP POST message encoder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Default template ID.private final org.slf4j.Logger
Class logger.private org.apache.velocity.app.VelocityEngine
Velocity engine used to evaluate the template when performing POST encoding.private String
ID of the velocity template used when performing POST encoding. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
doEncode()
Performs the encoding logic.protected void
Gets the SAML binding URI supported by this encoder.org.apache.velocity.app.VelocityEngine
Get the VelocityEngine instance.Get the Velocity template id.protected void
postEncode
(MessageContext messageContext, String endpointURL) Base64 and POST encodes the outbound message and writes it to the outbound transport.void
setVelocityEngine
(org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.void
setVelocityTemplateId
(String newVelocityTemplateId) Set the Velocity template id.Methods inherited from class org.opensaml.saml.saml1.binding.encoding.impl.BaseSAML1MessageEncoder
getEndpointURL
Methods inherited from class org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder
encode, getMessageToLog, logEncodedMessage, marshallMessage
Methods inherited from class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
getHttpServletResponse, setHttpServletResponse
Methods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
getMessageContext, prepareContext, setMessageContext
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
Methods inherited from interface org.opensaml.messaging.encoder.MessageEncoder
encode, prepareContext, setMessageContext
-
Field Details
-
DEFAULT_TEMPLATE_ID
Default template ID.- See Also:
-
log
private final org.slf4j.Logger logClass logger. -
velocityEngine
private org.apache.velocity.app.VelocityEngine velocityEngineVelocity engine used to evaluate the template when performing POST encoding. -
velocityTemplateId
ID of the velocity template used when performing POST encoding.
-
-
Constructor Details
-
HTTPPostEncoder
public HTTPPostEncoder()Constructor.
-
-
Method Details
-
getBindingURI
Gets the SAML binding URI supported by this encoder.- Returns:
- SAML binding URI supported by this encoder
-
getVelocityEngine
public org.apache.velocity.app.VelocityEngine getVelocityEngine()Get the VelocityEngine instance.- Returns:
- return the VelocityEngine instance
-
setVelocityEngine
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.- Parameters:
newVelocityEngine
- the new VelocityEngine instane
-
getVelocityTemplateId
Get the Velocity template id.Defaults to
DEFAULT_TEMPLATE_ID
.- Returns:
- return the Velocity template id
-
setVelocityTemplateId
Set the Velocity template id.Defaults to
DEFAULT_TEMPLATE_ID
.- Parameters:
newVelocityTemplateId
- the new Velocity template id
-
doDestroy
protected void doDestroy()- Overrides:
doDestroy
in classAbstractHttpServletResponseMessageEncoder
-
doInitialize
- Overrides:
doInitialize
in classAbstractHttpServletResponseMessageEncoder
- Throws:
ComponentInitializationException
-
doEncode
Performs the encoding logic. By the time this is called, this encoder has already been initialized and checked to ensure that it has not been destroyed.- Specified by:
doEncode
in classAbstractMessageEncoder
- Throws:
MessageEncodingException
- thrown if there is a problem encoding the message
-
postEncode
protected void postEncode(MessageContext messageContext, String endpointURL) throws MessageEncodingException Base64 and POST encodes the outbound message and writes it to the outbound transport.- Parameters:
messageContext
- current message contextendpointURL
- endpoint URL to encode message to- Throws:
MessageEncodingException
- thrown if there is a problem encoding the message
-