org.opensaml.common.binding.encoding.impl
Class AbstractMessageEncoder<ResponseType extends javax.servlet.ServletResponse>

java.lang.Object
  extended by org.opensaml.common.binding.encoding.impl.AbstractMessageEncoder<ResponseType>
Type Parameters:
ResponseType - the type of response the message is encoded to
All Implemented Interfaces:
MessageEncoder<ResponseType>
Direct Known Subclasses:
AbstractHTTPMessageEncoder

public abstract class AbstractMessageEncoder<ResponseType extends javax.servlet.ServletResponse>
extends java.lang.Object
implements MessageEncoder<ResponseType>

Base class handling boilerplate code for message encoders.


Constructor Summary
AbstractMessageEncoder()
           
 
Method Summary
 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.
protected  java.lang.String marshallMessage(XMLObject message)
          Marshalls an XML message and writes the element to a string using UTF-8 encoding.
 void setIssuer(java.lang.String id)
          Sets the issuer of the message.
 void setMetadataProvider(MetadataProvider provider)
          Sets the metadata provider that can be used to look up information about the relying party.
 void setRelyingParty(EntityDescriptor entity)
          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 role)
          Sets the role of the relying party the message will be encoded for.
 void setResponse(ResponseType rpResponse)
          Sets the response to use during the encoding process.
 void setSamlMessage(SAMLObject message)
          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.
 
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
 

Constructor Detail

AbstractMessageEncoder

public AbstractMessageEncoder()
Method Detail

getMetadataProvider

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

Specified by:
getMetadataProvider in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
the metadata provider that can be used to look up information about the relying party

setMetadataProvider

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

Specified by:
setMetadataProvider in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
provider - provider that can be used to look up information about the relying party, may not be null

getIssuer

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

Specified by:
getIssuer in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
issuer of the message

setIssuer

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

Specified by:
setIssuer in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
id - issuer of the message

getRelyingParty

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

Specified by:
getRelyingParty in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
relying party the message will be encoded for

setRelyingParty

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

Specified by:
setRelyingParty in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
entity - relying party the message will be encoded for, may not be null

getRelyingPartyEndpoint

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

Specified by:
getRelyingPartyEndpoint in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
endpoint to which the message will be sent

setRelyingPartyEndpoint

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

Specified by:
setRelyingPartyEndpoint in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
endpoint - endpoint to which the message will be sent

getRelyingPartyRole

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

Specified by:
getRelyingPartyRole in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
role of the relying party the message will be encoded for

setRelyingPartyRole

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

Specified by:
setRelyingPartyRole in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
role - role of the relying party the message will be encoded for

getSamlMessage

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

Specified by:
getSamlMessage in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
the SAML message that will be encoded and sent to the relying party

setSamlMessage

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

Specified by:
setSamlMessage in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
message - the SAML message to encode, may not be null

getSigningCredential

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

Specified by:
getSigningCredential in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
credential that should be used to sign the message

setSigningCredential

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

Specified by:
setSigningCredential in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
credential - credential that should be used to sign the message

getResponse

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

Specified by:
getResponse in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Returns:
response the response to use during encoding

setResponse

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

Specified by:
setResponse in interface MessageEncoder<ResponseType extends javax.servlet.ServletResponse>
Parameters:
rpResponse - the response to use during encoding

marshallMessage

protected java.lang.String marshallMessage(XMLObject message)
                                    throws BindingException
Marshalls an XML message and writes the element to a string using UTF-8 encoding.

Parameters:
message - the message to marshall
Returns:
the marshalled message
Throws:
BindingException - thrown if the message can not be marshalled