org.opensaml.common.binding.encoding
Interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>

Type Parameters:
ResponseType - the type of response the message is encoded to
All Known Subinterfaces:
HTTPMessageEncoder, SOAPEncoder<ResponseType>, SOAPHTTPEncoder
All Known Implementing Classes:
AbstractHTTPMessageEncoder, AbstractMessageEncoder, AbstractSAML2HTTPMessageEncoder, AbstractSOAPHTTPEncoder, HTTPArtifactEncoder, HTTPPostEncoder, HTTPPostEncoder, HTTPRedirectDeflateEncoder, HTTPSOAP11Encoder, HTTPSOAP11Encoder

public interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>

Encodes a SAML message in a binding specific manner. A given encoder instance need not be thread-safe or reusable. The process of encoding a message may change some of the properties set on this encoder. For example, a message may be required to be signed in a specific manner, so prior to the encoding the message may not be signed while afterwords it may be.


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.
 java.lang.String getIssuer()
          Gets the issuer of the message.
 MetadataProvider getMetadataProvider()
          Gets the metadata provider that can be used to look up information about the relying party.
 EntityDescriptor getRelyingParty()
          Gets the relying party the message will be encoded for.
 Endpoint getRelyingPartyEndpoint()
          Gets the endpoint to which the message will be sent.
 RoleDescriptor getRelyingPartyRole()
          Gets the role of the relying party the message will be encoded for.
 ResponseType getResponse()
          Sets the response to use during the encoding process.
 SAMLObject getSamlMessage()
          Gets the SAML message that will be encoded and sent to the relying party.
 Credential getSigningCredential()
          Gets the credential that should be used to sign the message.
 void setIssuer(java.lang.String issuer)
          Sets the issuer of the message.
 void setMetadataProvider(MetadataProvider metadatProvider)
          Sets the metadata provider that can be used to look up information about the relying party.
 void setRelyingParty(EntityDescriptor relyingParty)
          Sets relying party the message will be encoded for.
 void setRelyingPartyEndpoint(Endpoint endpoint)
          Sets the endpoint to which the message will be sent.
 void setRelyingPartyRole(RoleDescriptor relyingPartyRole)
          Sets the role of the relying party the message will be encoded for.
 void setResponse(ResponseType response)
          Sets the response to use during the encoding process.
 void setSamlMessage(SAMLObject samlMessage)
          Sets the SAML message that will be encoded and sent to the relying party.
 void setSigningCredential(Credential credential)
          Sets the credential that should be used to sign the message.
 

Method Detail

getBindingURI

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

Returns:
binding URI supported by this encoder

getMetadataProvider

MetadataProvider getMetadataProvider()
Gets the metadata provider that can be used to look up information about the relying party.

Returns:
the metadata provider that can be used to look up information about the relying party

setMetadataProvider

void setMetadataProvider(MetadataProvider metadatProvider)
Sets the metadata provider that can be used to look up information about the relying party.

Parameters:
metadatProvider - provider that can be used to look up information about the relying party, may not be null

getIssuer

java.lang.String getIssuer()
Gets the issuer of the message.

Returns:
issuer of the message

setIssuer

void setIssuer(java.lang.String issuer)
Sets the issuer of the message.

Parameters:
issuer - issuer of the message

getRelyingParty

EntityDescriptor getRelyingParty()
Gets the relying party the message will be encoded for.

Returns:
relying party the message will be encoded for

setRelyingParty

void setRelyingParty(EntityDescriptor relyingParty)
Sets relying party the message will be encoded for.

Parameters:
relyingParty - relying party the message will be encoded for, may not be null

getRelyingPartyRole

RoleDescriptor getRelyingPartyRole()
Gets the role of the relying party the message will be encoded for.

Returns:
role of the relying party the message will be encoded for

setRelyingPartyRole

void setRelyingPartyRole(RoleDescriptor relyingPartyRole)
Sets the role of the relying party the message will be encoded for.

Parameters:
relyingPartyRole - role of the relying party the message will be encoded for

getRelyingPartyEndpoint

Endpoint getRelyingPartyEndpoint()
Gets the endpoint to which the message will be sent.

Returns:
endpoint to which the message will be sent

setRelyingPartyEndpoint

void setRelyingPartyEndpoint(Endpoint endpoint)
Sets the endpoint to which the message will be sent.

Parameters:
endpoint - endpoint to which the message will be sent

getSamlMessage

SAMLObject getSamlMessage()
Gets the SAML message that will be encoded and sent to the relying party.

Returns:
the SAML message that will be encoded and sent to the relying party

setSamlMessage

void setSamlMessage(SAMLObject samlMessage)
Sets the SAML message that will be encoded and sent to the relying party.

Parameters:
samlMessage - the SAML message to encode, may not be null

getSigningCredential

Credential getSigningCredential()
Gets the credential that should be used to sign the message.

Returns:
credential that should be used to sign the message

setSigningCredential

void setSigningCredential(Credential credential)
Sets the credential that should be used to sign the message.

Parameters:
credential - credential that should be used to sign the message

getResponse

ResponseType getResponse()
Sets the response to use during the encoding process.

Returns:
response the response to use during encoding

setResponse

void setResponse(ResponseType response)
Sets the response to use during the encoding process.

Parameters:
response - the response to use during encoding

encode

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

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