org.opensaml.saml2.binding.encoding
Class HTTPPostEncoder

java.lang.Object
  extended by org.opensaml.ws.message.encoder.BaseMessageEncoder
      extended by org.opensaml.saml2.binding.encoding.BaseSAML2MessageEncoder
          extended by org.opensaml.saml2.binding.encoding.HTTPPostEncoder
All Implemented Interfaces:
SAMLMessageEncoder, MessageEncoder
Direct Known Subclasses:
HTTPPostSimpleSignEncoder

public class HTTPPostEncoder
extends BaseSAML2MessageEncoder

SAML 2.0 HTTP Post binding message encoder.


Field Summary
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
HTTPPostEncoder(org.apache.velocity.app.VelocityEngine engine, String templateId)
          Constructor.
 
Method Summary
protected  void doEncode(MessageContext messageContext)
          
 String getBindingURI()
          Gets the SAML binding URI supported by this encoder.
protected  void populateVelocityContext(org.apache.velocity.VelocityContext velocityContext, SAMLMessageContext messageContext, String endpointURL)
          Populate the Velocity context instance which will be used to render the POST body.
protected  void postEncode(SAMLMessageContext messageContext, String endpointURL)
          Base64 and POST encodes the outbound message and writes it to the outbound transport.
 boolean providesMessageConfidentiality(MessageContext messageContext)
          
 boolean providesMessageIntegrity(MessageContext messageContext)
          
 
Methods inherited from class org.opensaml.saml2.binding.encoding.BaseSAML2MessageEncoder
checkRelayState, getAllowedURLSchemes, getEndpointURL, setAllowedURLSchemes, setResponseDestination, signMessage
 
Methods inherited from class org.opensaml.ws.message.encoder.BaseMessageEncoder
encode, logEncodedMessage, marshallMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.ws.message.encoder.MessageEncoder
encode
 

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(org.apache.velocity.app.VelocityEngine engine,
                       String templateId)
Constructor.

Parameters:
engine - Velocity engine instance used to create POST body
templateId - ID of the template used to create POST body
Method Detail

getBindingURI

public String getBindingURI()
Gets the SAML binding URI supported by this encoder.

Returns:
SAML binding URI supported by this encoder

providesMessageConfidentiality

public boolean providesMessageConfidentiality(MessageContext messageContext)
                                       throws MessageEncodingException

Throws:
MessageEncodingException

providesMessageIntegrity

public boolean providesMessageIntegrity(MessageContext messageContext)
                                 throws MessageEncodingException

Throws:
MessageEncodingException

doEncode

protected void doEncode(MessageContext messageContext)
                 throws MessageEncodingException

Specified by:
doEncode in class BaseMessageEncoder
Throws:
MessageEncodingException

postEncode

protected void postEncode(SAMLMessageContext 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,
                                       SAMLMessageContext 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


Copyright © 1999-2012. All Rights Reserved.