Class BaseHttpClientRequestXMLMessageEncoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.messaging.encoder.httpclient.AbstractHttpClientRequestMessageEncoder
org.opensaml.messaging.encoder.httpclient.BaseHttpClientRequestXMLMessageEncoder
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,HttpClientRequestMessageEncoder,MessageEncoder
- Direct Known Subclasses:
HttpClientRequestSOAP11Encoder
public abstract class BaseHttpClientRequestXMLMessageEncoder
extends AbstractHttpClientRequestMessageEncoder
Base class for message encoders which encode XML messages to HttpRequest.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private org.slf4j.LoggerUsed to log protocol messages.Fields inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencode()Encode theMessageContextsupplied viaMessageEncoder.setMessageContext(MessageContext)to the sink.protected ElementmarshallMessage(XMLObject message) Helper method that marshalls the given message.protected StringserializeMessageForLogging(Object message) Serialize the message for logging purposes.Methods inherited from class org.opensaml.messaging.encoder.httpclient.AbstractHttpClientRequestMessageEncoder
doInitialize, getHttpRequest, setHttpRequestMethods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
doEncode, getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logEncodedMessage, prepareContext, 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.encoder.MessageEncoder
prepareContext, setMessageContext
-
Field Details
-
protocolMessageLog
@Nonnull private org.slf4j.Logger protocolMessageLogUsed to log protocol messages. -
log
@Nonnull private final org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
BaseHttpClientRequestXMLMessageEncoder
public BaseHttpClientRequestXMLMessageEncoder()
-
-
Method Details
-
encode
Encode theMessageContextsupplied viaMessageEncoder.setMessageContext(MessageContext)to the sink.- Specified by:
encodein interfaceMessageEncoder- Overrides:
encodein classAbstractMessageEncoder- Throws:
MessageEncodingException- if there is a problem encoding the message context
-
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 classAbstractMessageEncoder- Parameters:
message- the message to serialize- Returns:
- the serialized message, or null if message can not be serialized
-
marshallMessage
@Nonnull protected Element marshallMessage(@Nonnull XMLObject message) throws MessageEncodingException Helper method that marshalls the given message.- Parameters:
message- message the marshall and serialize- Returns:
- marshalled message
- Throws:
MessageEncodingException- thrown if the give message can not be marshalled into its DOM representation
-