Class HeaderMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.transform.HeaderMediator
-
- All Implemented Interfaces:
AspectConfigurable
,Mediator
,SynapseArtifact
public class HeaderMediator extends AbstractMediator
The header mediator is able to set a given value as a SOAP header, or remove a given header from the current message instance. This supports the headers currently supported by the HeaderType class. If an expression is supplied, its runtime value is evaluated using the current message. Unless the action is set to remove, the default behavior of this mediator is to set a header value.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACTION_REMOVE
static int
ACTION_SET
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description HeaderMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEmbeddedXml(org.apache.axiom.om.OMElement element)
int
getAction()
List<org.apache.axiom.om.OMElement>
getEmbeddedXml()
SynapsePath
getExpression()
String
getMediatorName()
Returns the name of the class of respective mediator.QName
getQName()
String
getScope()
String
getValue()
boolean
hasEmbeddedXml()
boolean
isContentAware()
boolean
isImplicit()
boolean
mediate(MessageContext synCtx)
Sets/Removes a SOAP header on the current messagevoid
setAction(int action)
void
setExpression(SynapsePath expression)
void
setQName(QName qName)
void
setScope(String scope)
void
setValue(String value)
-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Field Detail
-
ACTION_SET
public static final int ACTION_SET
- See Also:
- Constant Field Values
-
ACTION_REMOVE
public static final int ACTION_REMOVE
- See Also:
- Constant Field Values
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext synCtx)
Sets/Removes a SOAP header on the current message- Parameters:
synCtx
- the current message which is altered as necessary- Returns:
- true always
-
getScope
public String getScope()
-
setScope
public void setScope(String scope)
-
getAction
public int getAction()
-
setAction
public void setAction(int action)
-
getQName
public QName getQName()
-
setQName
public void setQName(QName qName)
-
getValue
public String getValue()
-
setValue
public void setValue(String value)
-
getExpression
public SynapsePath getExpression()
-
getEmbeddedXml
public List<org.apache.axiom.om.OMElement> getEmbeddedXml()
-
addEmbeddedXml
public void addEmbeddedXml(org.apache.axiom.om.OMElement element)
-
hasEmbeddedXml
public boolean hasEmbeddedXml()
-
isImplicit
public boolean isImplicit()
-
setExpression
public void setExpression(SynapsePath expression)
-
isContentAware
public boolean isContentAware()
- Specified by:
isContentAware
in interfaceMediator
- Overrides:
isContentAware
in classAbstractMediator
-
getMediatorName
public String getMediatorName()
Description copied from class:AbstractMediator
Returns the name of the class of respective mediator. This was introduced to provide a unique way to get the mediator name because getType is implemented in different ways in different mediators (e.g. PayloadFactoryMediator)- Specified by:
getMediatorName
in interfaceMediator
- Overrides:
getMediatorName
in classAbstractMediator
- Returns:
- a String of the mediator class name
-
-