org.opensaml.saml2.binding.encoding
Class HTTPPostEncoder

java.lang.Object
  extended by org.opensaml.common.binding.encoding.impl.AbstractMessageEncoder<javax.servlet.http.HttpServletResponse>
      extended by org.opensaml.common.binding.encoding.impl.AbstractHTTPMessageEncoder
          extended by org.opensaml.saml2.binding.encoding.AbstractSAML2HTTPMessageEncoder
              extended by org.opensaml.saml2.binding.encoding.HTTPPostEncoder
All Implemented Interfaces:
HTTPMessageEncoder, MessageEncoder<javax.servlet.http.HttpServletResponse>

public class HTTPPostEncoder
extends AbstractSAML2HTTPMessageEncoder

SAML 2.0 HTTP Post binding message encoder.


Field Summary
static java.lang.String BINDING_URI
          URI for this binding.
 
Constructor Summary
HTTPPostEncoder()
           
 
Method Summary
 void encode()
          Encode the SAML message in the binding specific manner.
 java.lang.String getBindingURI()
          Gets the binding URI supported by this encoder.
 org.apache.velocity.app.VelocityEngine getVelocityEngine()
          Gets the velocity engine used to evaluate the template when performing POST encoding.
 java.lang.String getVelocityTemplateId()
          Gets the ID of the velocity template used for POST encoding.
protected  void postEncode(java.io.Writer responseWriter, java.lang.String message)
          POST encodes the SAML message.
 void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine)
          Sets the velocity engine used to evaluate the template when performing POST encoding.
 void setVelocityTemplateId(java.lang.String id)
          Sets the ID of the velocity template used for POST encoding.
 
Methods inherited from class org.opensaml.saml2.binding.encoding.AbstractSAML2HTTPMessageEncoder
checkRelayState, getEndpointURL, signMessage
 
Methods inherited from class org.opensaml.common.binding.encoding.impl.AbstractHTTPMessageEncoder
getBase64EncodedMessage, getEncodeRelayState, getRelayState, initializeResponse, setRelayState
 
Methods inherited from class org.opensaml.common.binding.encoding.impl.AbstractMessageEncoder
getIssuer, getMetadataProvider, getRelyingParty, getRelyingPartyEndpoint, getRelyingPartyRole, getResponse, getSamlMessage, getSigningCredential, marshallMessage, setIssuer, setMetadataProvider, setRelyingParty, setRelyingPartyEndpoint, setRelyingPartyRole, setResponse, setSamlMessage, setSigningCredential
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.common.binding.encoding.MessageEncoder
getIssuer, getMetadataProvider, getRelyingParty, getRelyingPartyEndpoint, getRelyingPartyRole, getResponse, getSamlMessage, getSigningCredential, setIssuer, setMetadataProvider, setRelyingParty, setRelyingPartyEndpoint, setRelyingPartyRole, setResponse, setSamlMessage, setSigningCredential
 

Field Detail

BINDING_URI

public static final java.lang.String BINDING_URI
URI for this binding.

See Also:
Constant Field Values
Constructor Detail

HTTPPostEncoder

public HTTPPostEncoder()
Method Detail

getBindingURI

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

Returns:
binding URI supported by this encoder

getVelocityEngine

public org.apache.velocity.app.VelocityEngine getVelocityEngine()
Gets the velocity engine used to evaluate the template when performing POST encoding.

Returns:
velocity engine used to evaluate the template when performing POST encoding

setVelocityEngine

public void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine)
Sets the velocity engine used to evaluate the template when performing POST encoding.

Parameters:
engine - velocity engine used to evaluate the template when performing POST encoding

getVelocityTemplateId

public java.lang.String getVelocityTemplateId()
Gets the ID of the velocity template used for POST encoding.

Returns:
ID of the velocity template used for POST encoding

setVelocityTemplateId

public void setVelocityTemplateId(java.lang.String id)
Sets the ID of the velocity template used for POST encoding.

Parameters:
id - ID of the velocity template used for POST encoding

encode

public void encode()
            throws BindingException
Encode the SAML message in the binding specific manner.

Throws:
BindingException - thrown if the problem can not be encoded

postEncode

protected void postEncode(java.io.Writer responseWriter,
                          java.lang.String message)
                   throws BindingException
POST encodes the SAML message.

Parameters:
responseWriter - writer to write the encoded message to
message - base64 encoded SAML message
Throws:
BindingException - thrown if the message can not be written to the writer