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
public class AddMessageIDHandler extends AbstractHeaderGeneratingMessageHandler
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 strategygetIdentifierGenerationStrategy()will be used. If neither of those sources are available, then a random "urn:uuid:..." URI value will be generated internally usingUUID.
-
-
Field Summary
Fields Modifier and Type Field Description private IdentifierGenerationStrategyidentifierGenerationStrategyStrategy for generating identifiers.private org.slf4j.LoggerlogLogger.
-
Constructor Summary
Constructors Constructor Description AddMessageIDHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInvoke(MessageContext messageContext)IdentifierGenerationStrategygetIdentifierGenerationStrategy()Get the identifier generation strategy.protected StringgetMessageID(MessageContext messageContext)Get the effective message ID value to issue in the outbound message.voidsetIdentifierGenerationStrategy(IdentifierGenerationStrategy strategy)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 Detail
-
log
private org.slf4j.Logger log
Logger.
-
identifierGenerationStrategy
private IdentifierGenerationStrategy identifierGenerationStrategy
Strategy for generating identifiers.
-
-
Method Detail
-
getIdentifierGenerationStrategy
@Nullable public IdentifierGenerationStrategy getIdentifierGenerationStrategy()
Get the identifier generation strategy.- Returns:
- the strategy, or null
-
setIdentifierGenerationStrategy
public void setIdentifierGenerationStrategy(@Nullable IdentifierGenerationStrategy strategy)Set the identifier generation strategy.- Parameters:
strategy- the new strategy
-
doInvoke
protected void doInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException- Specified by:
doInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-
getMessageID
@Nonnull protected String getMessageID(MessageContext messageContext)
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
-
-