Class BaseHttpServletRequestXMLMessageDecoder

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, net.shibboleth.utilities.java.support.component.UnmodifiableComponent, MessageDecoder, HttpServletRequestMessageDecoder

    public abstract class BaseHttpServletRequestXMLMessageDecoder
    extends AbstractHttpServletRequestMessageDecoder
    Base class for message decoders which decode XML messages from an HttpServletRequest.
    • Field Detail

      • protocolMessageLog

        @Nonnull
        private org.slf4j.Logger protocolMessageLog
        Used to log protocol messages.
      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • parserPool

        @Nonnull
        private net.shibboleth.utilities.java.support.xml.ParserPool parserPool
        Parser pool used to deserialize the message.
    • Constructor Detail

      • BaseHttpServletRequestXMLMessageDecoder

        public BaseHttpServletRequestXMLMessageDecoder()
        Constructor.
    • Method Detail

      • getParserPool

        @Nonnull
        public net.shibboleth.utilities.java.support.xml.ParserPool getParserPool()
        Gets the parser pool used to deserialize incoming messages.
        Returns:
        parser pool used to deserialize incoming messages
      • setParserPool

        public void setParserPool​(@Nonnull
                                  net.shibboleth.utilities.java.support.xml.ParserPool pool)
        Sets the parser pool used to deserialize incoming messages.
        Parameters:
        pool - parser pool used to deserialize incoming messages
      • doInitialize

        protected void doInitialize()
                             throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
        Overrides:
        doInitialize in class AbstractHttpServletRequestMessageDecoder
        Throws:
        net.shibboleth.utilities.java.support.component.ComponentInitializationException
      • logDecodedMessage

        protected void logDecodedMessage()
        Log the decoded message to the protocol message logger.
      • getMessageToLog

        protected Object getMessageToLog()
        Get the XMLObject which will be logged as the protocol message.
        Returns:
        the XMLObject message considered to be the protocol message for logging purposes
      • unmarshallMessage

        protected org.opensaml.core.xml.XMLObject unmarshallMessage​(InputStream messageStream)
                                                             throws MessageDecodingException
        Helper method that deserializes and unmarshalls the message from the given stream.
        Parameters:
        messageStream - input stream containing the message
        Returns:
        the inbound message
        Throws:
        MessageDecodingException - thrown if there is a problem deserializing and unmarshalling the message
      • validateHttpRequest

        protected void validateHttpRequest​(javax.servlet.http.HttpServletRequest request)
                                    throws MessageDecodingException
        Perform optional validation of the inbound HttpServletRequest.

        This method is called before the main MessageDecoder.decode() logic}.

        The default behavior is a no-op. Subclasses may override with specific constraints.

        Parameters:
        request - the HTTP request being validate
        Throws:
        MessageDecodingException - if request is not considered valid