org.opensaml.saml2.binding.encoding
Class AbstractSAML2HTTPMessageEncoder

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
All Implemented Interfaces:
HTTPMessageEncoder, MessageEncoder<javax.servlet.http.HttpServletResponse>
Direct Known Subclasses:
HTTPArtifactEncoder, HTTPPostEncoder, HTTPRedirectDeflateEncoder

public abstract class AbstractSAML2HTTPMessageEncoder
extends AbstractHTTPMessageEncoder

Base class for SAML 2 HTTP message encoders.


Constructor Summary
AbstractSAML2HTTPMessageEncoder()
           
 
Method Summary
protected  boolean checkRelayState()
          Checks that the relay state is 80 bytes or less.
protected  java.lang.String getEndpointURL()
          Gets the response URL from the relying party endpoint.
protected  void signMessage()
          Signs the given SAML message if it a SignableSAMLObject and this encoder has signing credentials.
 
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
encode, getBindingURI, getIssuer, getMetadataProvider, getRelyingParty, getRelyingPartyEndpoint, getRelyingPartyRole, getResponse, getSamlMessage, getSigningCredential, setIssuer, setMetadataProvider, setRelyingParty, setRelyingPartyEndpoint, setRelyingPartyRole, setResponse, setSamlMessage, setSigningCredential
 

Constructor Detail

AbstractSAML2HTTPMessageEncoder

public AbstractSAML2HTTPMessageEncoder()
Method Detail

getEndpointURL

protected java.lang.String getEndpointURL()
                                   throws BindingException
Gets the response URL from the relying party endpoint. If the SAML message is a Response and the relying party endpoint contains a response location then that location is returned otherwise the normal endpoint location is returned.

Returns:
response URL from the relying party endpoint
Throws:
BindingException - throw if no relying party endpoint is available

checkRelayState

protected boolean checkRelayState()
                           throws BindingException
Checks that the relay state is 80 bytes or less.

Returns:
true if the relay state is not empty and is less than 80 bytes
Throws:
BindingException - thrown if the relay state is larger than 80 bytes

signMessage

protected void signMessage()
Signs the given SAML message if it a SignableSAMLObject and this encoder has signing credentials.