Class HTTPPostEncoder

    • 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
      • 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 context
        endpointURL - endpoint URL to which to encode message
        Throws:
        MessageEncodingException - thrown if there is a problem encoding the message
      • populateVelocityContext

        protected void populateVelocityContext​(org.apache.velocity.VelocityContext velocityContext,
                                               MessageContext messageContext,
                                               String endpointURL)
                                        throws MessageEncodingException
        Populate the Velocity context instance which will be used to render the POST body.
        Parameters:
        velocityContext - the Velocity context instance to populate with data
        messageContext - the SAML message context source of data
        endpointURL - endpoint URL to which to encode message
        Throws:
        MessageEncodingException - thrown if there is a problem encoding the message