Interface MessageEncoder
- All Superinterfaces:
Component,DestructableComponent,InitializableComponent
- All Known Subinterfaces:
HTMLMessageEncoder,HttpClientRequestMessageEncoder,HttpServletResponseMessageEncoder,SAMLMessageEncoder
- All Known Implementing Classes:
AbstractHttpClientRequestMessageEncoder,AbstractHttpServletResponseMessageEncoder,AbstractMessageEncoder,BaseHttpClientRequestXMLMessageEncoder,BaseHttpServletResponseXMLMessageEncoder,BaseSAML1MessageEncoder,BaseSAML2MessageEncoder,BaseSAMLHttpServletResponseEncoder,HTTPArtifactEncoder,HTTPArtifactEncoder,HttpClientRequestSOAP11Encoder,HttpClientRequestSOAP11Encoder,HttpClientRequestSOAP11Encoder,HTTPPostEncoder,HTTPPostEncoder,HTTPPostSimpleSignEncoder,HTTPRedirectDeflateEncoder,HTTPSOAP11Encoder,HTTPSOAP11Encoder,HTTPSOAP11Encoder
MessageContext to a sink. Before the encoder can be
used the InitializableComponent.initialize() method must be called. After the encoder has been used the DestructableComponent.destroy() should
be invoked in order to clean up any resources.
The sink data or structure on which the encoder operates is supplied in an implementation-specific manner.
-
Method Summary
Modifier and TypeMethodDescriptionvoidencode()Encode theMessageContextsupplied viasetMessageContext(MessageContext)to the sink.voidThis method should prepare the message context by creating and populating any binding-specific data structures required in the MessageContext, prior to actually encoding.voidsetMessageContext(MessageContext messageContext) Set theMessageContextwhich is to be encoded.Methods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Method Details
-
prepareContext
This method should prepare the message context by creating and populating any binding-specific data structures required in the MessageContext, prior to actually encoding.This method should be called after the MessageContext has been set, and before any binding-specific Handler or HandlerChains are invoked.
Example: For a SOAP encoder, this method would create and store the basic SOAP Envelope structure in the message context, so that Handlers that are invoked have a place to which to add headers.
This method may be a no-op if not required by the binding, or if the message type of the context implies that the binding-specific structures have already been created elsewhere (e.g. message-oriented code where the calling code already knows its SOAP, and is operating on the raw SOAP envelope anyway).
- Throws:
MessageEncodingException- if there is a problem preparing the message context for encoding
-
encode
Encode theMessageContextsupplied viasetMessageContext(MessageContext)to the sink.- Throws:
MessageEncodingException- if there is a problem encoding the message context
-
setMessageContext
Set theMessageContextwhich is to be encoded.- Parameters:
messageContext- the message context
-