Class BaseHttpClientResponseXMLMessageDecoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.decoder.AbstractMessageDecoder
org.opensaml.messaging.decoder.httpclient.AbstractHttpClientResponseMessageDecoder
org.opensaml.messaging.decoder.httpclient.BaseHttpClientResponseXMLMessageDecoder
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,HttpClientResponseMessageDecoder,MessageDecoder
- Direct Known Subclasses:
HttpClientResponseSOAP11Decoder
public abstract class BaseHttpClientResponseXMLMessageDecoder
extends AbstractHttpClientResponseMessageDecoder
Base class for message decoders which decode XML messages from a
ClassicHttpResponse.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private ParserPoolParser pool used to deserialize the message.Fields inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode()Decode message data from the source and store it so that it may be retrieved viaMessageDecoder.getMessageContext().protected voidGets the parser pool used to deserialize incoming messages.protected StringserializeMessageForLogging(Object message) Serialize the message for logging purposes.voidsetParserPool(ParserPool pool) Sets the parser pool used to deserialize incoming messages.protected XMLObjectunmarshallMessage(InputStream messageStream) Helper method that deserializes and unmarshalls the message from the given stream.Methods inherited from class org.opensaml.messaging.decoder.httpclient.AbstractHttpClientResponseMessageDecoder
getHttpResponse, setHttpResponseMethods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
doDecode, getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logDecodedMessage, setMessageContext, setProtocolMessageLoggerSubCategoryMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitializedMethods inherited from interface org.opensaml.messaging.decoder.MessageDecoder
getMessageContext
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
parserPool
Parser pool used to deserialize the message.
-
-
Constructor Details
-
BaseHttpClientResponseXMLMessageDecoder
public BaseHttpClientResponseXMLMessageDecoder()Constructor.
-
-
Method Details
-
decode
Decode message data from the source and store it so that it may be retrieved viaMessageDecoder.getMessageContext().- Specified by:
decodein interfaceMessageDecoder- Overrides:
decodein classAbstractMessageDecoder- 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
-
doInitialize
- Overrides:
doInitializein classAbstractHttpClientResponseMessageDecoder- Throws:
ComponentInitializationException
-
serializeMessageForLogging
Serialize the message for logging purposes.Default implementation is to return the message object's
Object.toString(), but subclasses should override if a better message-specific serialization mechanism exists.- Overrides:
serializeMessageForLoggingin classAbstractMessageDecoder- Parameters:
message- the message to serialize- Returns:
- the serialized message, or null if message can not be serialized
-
unmarshallMessage
protected XMLObject unmarshallMessage(@Nonnull 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
-