Class AddMessageIDHandler
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
org.opensaml.soap.messaging.AbstractHeaderGeneratingMessageHandler
org.opensaml.soap.wsaddressing.messaging.impl.AddMessageIDHandler
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,MessageHandler
Handler implementation that adds a wsa:MessageID header to the outbound SOAP envelope.
The value from WSAddressingContext.getMessageIDURI()
will be used, if present. If not,
then the value generated via the locally-configured strategy getIdentifierGenerationStrategy()
will be used. If neither of those sources are available, then a random "urn:uuid:..." URI value will be
generated internally using UUID
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IdentifierGenerationStrategy
Strategy for generating identifiers.private org.slf4j.Logger
Logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doInvoke
(MessageContext messageContext) Performs the handler logic.Get the identifier generation strategy.protected String
getMessageID
(MessageContext messageContext) Get the effective message ID value to issue in the outbound message.void
Set the identifier generation strategy.Methods inherited from class org.opensaml.soap.messaging.AbstractHeaderGeneratingMessageHandler
decorateGeneratedHeader, doPreInvoke, getEffectiveTargetNode, isEffectiveMustUnderstand, setMustUnderstand, setMustUnderstandStrategy, setTargetNode, setTargetNodeStrategy
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, 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.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
private org.slf4j.Logger logLogger. -
identifierGenerationStrategy
Strategy for generating identifiers.
-
-
Constructor Details
-
AddMessageIDHandler
public AddMessageIDHandler()
-
-
Method Details
-
getIdentifierGenerationStrategy
Get the identifier generation strategy.- Returns:
- the strategy, or null
-
setIdentifierGenerationStrategy
Set the identifier generation strategy.- Parameters:
strategy
- the new strategy
-
doInvoke
Performs the handler logic.- Specified by:
doInvoke
in classAbstractMessageHandler
- Parameters:
messageContext
- the message context on which to invoke the handler- Throws:
MessageHandlerException
- if there is an error invoking the handler on the message context
-
getMessageID
Get the effective message ID value to issue in the outbound message.- Parameters:
messageContext
- the current message context- Returns:
- the retrieved or generated message ID
-