org.opensaml.saml2.binding.encoding
Class HTTPArtifactEncoder

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.HTTPArtifactEncoder
All Implemented Interfaces:
SAMLMessageEncoder, org.opensaml.ws.message.encoder.MessageEncoder

public class HTTPArtifactEncoder
extends BaseSAML2MessageEncoder

SAML 2 Artifact Binding encoder, support both HTTP GET and POST.


Constructor Summary
HTTPArtifactEncoder(org.apache.velocity.app.VelocityEngine engine, String template, SAMLArtifactMap map)
          Constructor.
 
Method Summary
protected  AbstractSAML2Artifact buildArtifact(SAMLMessageContext artifactContext)
          Builds the SAML 2 artifact for the outgoing message.
protected  void doEncode(org.opensaml.ws.message.MessageContext messageContext)
          
 String getBindingURI()
          Gets the SAML binding URI supported by this encoder.
protected  void getEncode(SAMLMessageContext artifactContext, org.opensaml.ws.transport.http.HTTPOutTransport outTransport)
          Performs HTTP GET based encoding.
 boolean isPostEncoding()
          Gets whether the encoder will encode the artifact via POST encoding.
protected  void postEncode(SAMLMessageContext artifactContext, org.opensaml.ws.transport.http.HTTPOutTransport outTransport)
          Performs HTTP POST based encoding.
 boolean providesMessageConfidentiality(org.opensaml.ws.message.MessageContext messageContext)
          
 boolean providesMessageIntegrity(org.opensaml.ws.message.MessageContext messageContext)
          
 void setPostEncoding(boolean post)
          Sets whether the encoder will encode the artifact via POST encoding.
 
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
 

Constructor Detail

HTTPArtifactEncoder

public HTTPArtifactEncoder(org.apache.velocity.app.VelocityEngine engine,
                           String template,
                           SAMLArtifactMap map)
Constructor.

Parameters:
engine - velocity engine used to construct the POST form
template - ID of velocity template used to construct the POST form
map - artifact map used to store artifact/message bindings
Method Detail

getBindingURI

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

Returns:
SAML binding URI supported by this encoder

isPostEncoding

public boolean isPostEncoding()
Gets whether the encoder will encode the artifact via POST encoding.

Returns:
true if POST encoding will be used, false if GET encoding will be used

setPostEncoding

public void setPostEncoding(boolean post)
Sets whether the encoder will encode the artifact via POST encoding.

Parameters:
post - true if POST encoding will be used, false if GET encoding will be used

providesMessageConfidentiality

public boolean providesMessageConfidentiality(org.opensaml.ws.message.MessageContext messageContext)
                                       throws org.opensaml.ws.message.encoder.MessageEncodingException

Throws:
org.opensaml.ws.message.encoder.MessageEncodingException

providesMessageIntegrity

public boolean providesMessageIntegrity(org.opensaml.ws.message.MessageContext messageContext)
                                 throws org.opensaml.ws.message.encoder.MessageEncodingException

Throws:
org.opensaml.ws.message.encoder.MessageEncodingException

doEncode

protected void doEncode(org.opensaml.ws.message.MessageContext messageContext)
                 throws org.opensaml.ws.message.encoder.MessageEncodingException

Specified by:
doEncode in class org.opensaml.ws.message.encoder.BaseMessageEncoder
Throws:
org.opensaml.ws.message.encoder.MessageEncodingException

postEncode

protected void postEncode(SAMLMessageContext artifactContext,
                          org.opensaml.ws.transport.http.HTTPOutTransport outTransport)
                   throws org.opensaml.ws.message.encoder.MessageEncodingException
Performs HTTP POST based encoding.

Parameters:
artifactContext - current request context
outTransport - outbound HTTP transport
Throws:
org.opensaml.ws.message.encoder.MessageEncodingException - thrown if there is a problem POST encoding the artifact

getEncode

protected void getEncode(SAMLMessageContext artifactContext,
                         org.opensaml.ws.transport.http.HTTPOutTransport outTransport)
                  throws org.opensaml.ws.message.encoder.MessageEncodingException
Performs HTTP GET based encoding.

Parameters:
artifactContext - current request context
outTransport - outbound HTTP transport
Throws:
org.opensaml.ws.message.encoder.MessageEncodingException - thrown if there is a problem GET encoding the artifact

buildArtifact

protected AbstractSAML2Artifact buildArtifact(SAMLMessageContext artifactContext)
                                       throws org.opensaml.ws.message.encoder.MessageEncodingException
Builds the SAML 2 artifact for the outgoing message.

Parameters:
artifactContext - current request context
Returns:
SAML 2 artifact for outgoing message
Throws:
org.opensaml.ws.message.encoder.MessageEncodingException - thrown if the artifact can not be created


Copyright © 2006-2011 Internet2. All Rights Reserved.