Package org.opensaml.soap.messaging
Class AbstractHeaderGeneratingMessageHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
org.opensaml.soap.messaging.AbstractHeaderGeneratingMessageHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
- Direct Known Subclasses:
AddActionHandler,AddMessageIDHandler,AddRelatesToHandler,AddTimestampHandler
Abstract base class for message handlers that generate SOAP headers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanThe effective mustUnderstand value to use.private StringThe effective target node value to use.private booleanThe statically configured value for mustUnderstand.private Predicate<MessageContext>Predicate strategy for evaluating mustUnderstand from the message context.private StringThe statically configured value for target node (SOAP 1.1 actor or SOAP 1.2 role).private Function<MessageContext,String> Function strategy for resolving target node from the message context. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecorateGeneratedHeader(MessageContext messageContext, XMLObject header) Decorate the header based on configured and/or resolved values.protected booleandoPreInvoke(MessageContext messageContext) Called prior to execution, handlers may override this method to perform pre-processing for a request.protected StringGet the effective value for target node (SOAP 1.1 actor or SOAP 1.2 role).protected booleanGet the effective value for mustUnderstand.voidsetMustUnderstand(boolean flag) Set the statically configured value for mustUnderstand.voidsetMustUnderstandStrategy(Predicate<MessageContext> strategy) Set the predicate strategy for evaluating mustUnderstand from the message context.voidsetTargetNode(String node) Set the statically configured value for target node (SOAP 1.1 actor or SOAP 1.2 role).voidsetTargetNodeStrategy(Function<MessageContext, String> strategy) Set the predicate strategy for evaluating mustUnderstand from the message context.Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doInvoke, doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationConditionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, 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.InitializableComponent
initialize, isInitialized
-
Field Details
-
mustUnderstand
private boolean mustUnderstandThe statically configured value for mustUnderstand. -
mustUnderstandStrategy
Predicate strategy for evaluating mustUnderstand from the message context. -
effectiveMustUnderstand
private boolean effectiveMustUnderstandThe effective mustUnderstand value to use. -
targetNode
The statically configured value for target node (SOAP 1.1 actor or SOAP 1.2 role). -
targetNodeStrategy
Function strategy for resolving target node from the message context. -
effectiveTargetNode
The effective target node value to use.
-
-
Constructor Details
-
AbstractHeaderGeneratingMessageHandler
public AbstractHeaderGeneratingMessageHandler()
-
-
Method Details
-
setMustUnderstand
public void setMustUnderstand(boolean flag) Set the statically configured value for mustUnderstand.- Parameters:
flag- true if header must be understood, false if not
-
setMustUnderstandStrategy
Set the predicate strategy for evaluating mustUnderstand from the message context.- Parameters:
strategy- the predicate strategy
-
isEffectiveMustUnderstand
protected boolean isEffectiveMustUnderstand()Get the effective value for mustUnderstand.- Returns:
- the effective value for mustUnderstand.
-
setTargetNode
Set the statically configured value for target node (SOAP 1.1 actor or SOAP 1.2 role).- Parameters:
node- the target node, may be null
-
setTargetNodeStrategy
Set the predicate strategy for evaluating mustUnderstand from the message context.- Parameters:
strategy- the predicate strategy
-
getEffectiveTargetNode
Get the effective value for target node (SOAP 1.1 actor or SOAP 1.2 role).- Returns:
- the effective value for target node
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException Called prior to execution, handlers may override this method to perform pre-processing for a request.The default impl applies the
Predicateset via theAbstractMessageHandler.setActivationCondition(Predicate).If false is returned, execution will not proceed.
Subclasses which override this method should generally invoke the super version of this method first, so that the activation condition will be applied up front, and immediately return false if the super version returns false. This avoids unnecessary execution of the remaining pre-invocation code if the handler ultimately will not execute.
- Overrides:
doPreInvokein classAbstractMessageHandler- Parameters:
messageContext- the message context on which to invoke the handler- Returns:
- true iff execution should proceed
- Throws:
MessageHandlerException- if there is a problem executing the handler pre-routine
-
decorateGeneratedHeader
protected void decorateGeneratedHeader(@Nonnull MessageContext messageContext, @Nonnull XMLObject header) Decorate the header based on configured and/or resolved values.- Parameters:
messageContext- the current message contextheader- the header to decorate
-