Class BaseHttpServletRequestXMLMessageDecoder
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.messaging.decoder.AbstractMessageDecoder
org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
org.opensaml.messaging.decoder.servlet.BaseHttpServletRequestXMLMessageDecoder
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,UnmodifiableComponent
,MessageDecoder
,HttpServletRequestMessageDecoder
- Direct Known Subclasses:
HTTPArtifactDecoder
,HTTPArtifactDecoder
,HTTPPostDecoder
,HTTPPostDecoder
,HTTPRedirectDeflateDecoder
,HTTPSOAP11Decoder
public abstract class BaseHttpServletRequestXMLMessageDecoder
extends AbstractHttpServletRequestMessageDecoder
Base class for message decoders which decode XML messages from an
HttpServletRequest
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.Logger
Class logger.private ParserPool
Parser pool used to deserialize the message.private org.slf4j.Logger
Used to log protocol messages. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
decode()
Decode message data from the source and store it so that it may be retrieved viaMessageDecoder.getMessageContext()
.protected void
protected void
protected Object
Get the XMLObject which will be logged as the protocol message.Gets the parser pool used to deserialize incoming messages.protected void
Log the decoded message to the protocol message logger.void
setParserPool
(ParserPool pool) Sets the parser pool used to deserialize incoming messages.protected XMLObject
unmarshallMessage
(InputStream messageStream) Helper method that deserializes and unmarshalls the message from the given stream.protected void
validateHttpRequest
(javax.servlet.http.HttpServletRequest request) Perform optional validation of the inboundHttpServletRequest
.Methods inherited from class org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
getHttpServletRequest, setHttpServletRequest
Methods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
doDecode, getMessageContext, setMessageContext
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
Methods inherited from interface org.opensaml.messaging.decoder.MessageDecoder
getMessageContext
-
Field Details
-
protocolMessageLog
@Nonnull private org.slf4j.Logger protocolMessageLogUsed to log protocol messages. -
log
@Nonnull private final org.slf4j.Logger logClass logger. -
parserPool
Parser pool used to deserialize the message.
-
-
Constructor Details
-
BaseHttpServletRequestXMLMessageDecoder
public BaseHttpServletRequestXMLMessageDecoder()Constructor.
-
-
Method Details
-
decode
Decode message data from the source and store it so that it may be retrieved viaMessageDecoder.getMessageContext()
.- Specified by:
decode
in interfaceMessageDecoder
- Overrides:
decode
in classAbstractHttpServletRequestMessageDecoder
- Throws:
MessageDecodingException
- if there is a problem decoding the message context
-
getParserPool
Gets the parser pool used to deserialize incoming messages.- Returns:
- parser pool used to deserialize incoming messages
-
setParserPool
Sets the parser pool used to deserialize incoming messages.- Parameters:
pool
- parser pool used to deserialize incoming messages
-
doDestroy
protected void doDestroy()- Overrides:
doDestroy
in classAbstractHttpServletRequestMessageDecoder
-
doInitialize
- Overrides:
doInitialize
in classAbstractHttpServletRequestMessageDecoder
- Throws:
ComponentInitializationException
-
logDecodedMessage
protected void logDecodedMessage()Log the decoded message to the protocol message logger. -
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
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 inboundHttpServletRequest
.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
-