Class HTTPPostEncoder

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, net.shibboleth.utilities.java.support.component.UnmodifiableComponent, org.opensaml.messaging.encoder.MessageEncoder, org.opensaml.messaging.encoder.servlet.HttpServletResponseMessageEncoder, org.opensaml.saml.common.binding.encoding.SAMLMessageEncoder

    public class HTTPPostEncoder
    extends BaseSAML1MessageEncoder
    SAML 1.X HTTP POST message encoder.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String DEFAULT_TEMPLATE_ID
      Default template ID.
      private org.slf4j.Logger log
      Class logger.
      private org.apache.velocity.app.VelocityEngine velocityEngine
      Velocity engine used to evaluate the template when performing POST encoding.
      private String velocityTemplateId
      ID of the velocity template used when performing POST encoding.
    • Constructor Summary

      Constructors 
      Constructor Description
      HTTPPostEncoder()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doDestroy()
      protected void doEncode()
      protected void doInitialize()
      String getBindingURI()
      org.apache.velocity.app.VelocityEngine getVelocityEngine()
      Get the VelocityEngine instance.
      String getVelocityTemplateId()
      Get the Velocity template id.
      protected void postEncode​(org.opensaml.messaging.context.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.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 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 Detail

      • log

        private final org.slf4j.Logger log
        Class logger.
      • velocityEngine

        private org.apache.velocity.app.VelocityEngine velocityEngine
        Velocity engine used to evaluate the template when performing POST encoding.
      • velocityTemplateId

        private String velocityTemplateId
        ID of the velocity template used when performing POST encoding.
    • Constructor Detail

      • HTTPPostEncoder

        public HTTPPostEncoder()
        Constructor.
    • Method Detail

      • getBindingURI

        public String getBindingURI()
      • 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

        public String getVelocityTemplateId()
        Get the Velocity template id.

        Defaults to DEFAULT_TEMPLATE_ID.

        Returns:
        return the Velocity template id
      • setVelocityTemplateId

        public void setVelocityTemplateId​(String newVelocityTemplateId)
        Set the Velocity template id.

        Defaults to DEFAULT_TEMPLATE_ID.

        Parameters:
        newVelocityTemplateId - the new Velocity template id
      • doDestroy

        protected void doDestroy()
        Overrides:
        doDestroy in class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
      • doInitialize

        protected void doInitialize()
                             throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
        Overrides:
        doInitialize in class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
        Throws:
        net.shibboleth.utilities.java.support.component.ComponentInitializationException
      • doEncode

        protected void doEncode()
                         throws org.opensaml.messaging.encoder.MessageEncodingException
        Specified by:
        doEncode in class org.opensaml.messaging.encoder.AbstractMessageEncoder
        Throws:
        org.opensaml.messaging.encoder.MessageEncodingException
      • postEncode

        protected void postEncode​(org.opensaml.messaging.context.MessageContext messageContext,
                                  String endpointURL)
                           throws org.opensaml.messaging.encoder.MessageEncodingException
        Base64 and POST encodes the outbound message and writes it to the outbound transport.
        Parameters:
        messageContext - current message context
        endpointURL - endpoint URL to encode message to
        Throws:
        org.opensaml.messaging.encoder.MessageEncodingException - thrown if there is a problem encoding the message