Class IterateMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.eip.splitter.IterateMediator
-
- All Implemented Interfaces:
AspectConfigurable
,ManagedLifecycle
,Mediator
,FlowContinuableMediator
,SynapseArtifact
public class IterateMediator extends AbstractMediator implements ManagedLifecycle, FlowContinuableMediator
Splits a message using an XPath expression and creates a new message to hold each resulting element. This is very much similar to the clone mediator, and hands over the newly created messages to a target for processing
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description IterateMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
This method should implement the destroying of the implemented parts of the configuration.SynapsePath
getAttachPath()
SynapsePath
getExpression()
String
getId()
Target
getTarget()
void
init(SynapseEnvironment se)
This method should implement the initialization of the implemented parts of the configuration.boolean
isAttachPathPresent()
boolean
isContentAltering()
This is used to indicate whether message payload get modified during mediationboolean
isContinueParent()
boolean
isPreservePayload()
boolean
mediate(MessageContext synCtx)
Splits the message by iterating over the results of the given Path expressionboolean
mediate(MessageContext synCtx, ContinuationState continuationState)
Mediate the message using a ContinuationState.Integer
reportOpenStatistics(MessageContext messageContext, boolean isContentAltering)
Report Open Statistic Event for the Mediatorvoid
setAttachPath(SynapsePath attachPath)
void
setAttachPathPresent(boolean attachPathPresent)
void
setComponentStatisticsId(ArtifactHolder holder)
void
setContinueParent(boolean continueParent)
void
setExpression(SynapsePath expression)
void
setId(String id)
void
setPreservePayload(boolean preservePayload)
void
setTarget(Target target)
-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAware, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, setBreakPoint, setCommentsList, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext synCtx)
Splits the message by iterating over the results of the given Path expression
-
mediate
public boolean mediate(MessageContext synCtx, ContinuationState continuationState)
Description copied from interface:FlowContinuableMediator
Mediate the message using a ContinuationState. This is used when mediating the response message when service is invoked using a Call Mediator.- Specified by:
mediate
in interfaceFlowContinuableMediator
- Parameters:
synCtx
- MessageContextcontinuationState
- ContinuationState- Returns:
- whether mediation flow is completed
-
isContinueParent
public boolean isContinueParent()
-
setContinueParent
public void setContinueParent(boolean continueParent)
-
isPreservePayload
public boolean isPreservePayload()
-
setPreservePayload
public void setPreservePayload(boolean preservePayload)
-
getExpression
public SynapsePath getExpression()
-
setExpression
public void setExpression(SynapsePath expression)
-
getAttachPath
public SynapsePath getAttachPath()
-
setAttachPath
public void setAttachPath(SynapsePath attachPath)
-
getTarget
public Target getTarget()
-
setTarget
public void setTarget(Target target)
-
getId
public String getId()
-
setId
public void setId(String id)
-
isContentAltering
public boolean isContentAltering()
Description copied from interface:Mediator
This is used to indicate whether message payload get modified during mediation- Specified by:
isContentAltering
in interfaceMediator
- Overrides:
isContentAltering
in classAbstractMediator
- Returns:
- whether mediator modify the payload
-
isAttachPathPresent
public boolean isAttachPathPresent()
-
setAttachPathPresent
public void setAttachPathPresent(boolean attachPathPresent)
-
init
public void init(SynapseEnvironment se)
Description copied from interface:ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.- Specified by:
init
in interfaceManagedLifecycle
- Parameters:
se
- SynapseEnvironment to be used for initialization
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in interfaceManagedLifecycle
-
reportOpenStatistics
public Integer reportOpenStatistics(MessageContext messageContext, boolean isContentAltering)
Description copied from interface:Mediator
Report Open Statistic Event for the Mediator- Specified by:
reportOpenStatistics
in interfaceMediator
- Overrides:
reportOpenStatistics
in classAbstractMediator
-
setComponentStatisticsId
public void setComponentStatisticsId(ArtifactHolder holder)
- Specified by:
setComponentStatisticsId
in interfaceMediator
- Overrides:
setComponentStatisticsId
in classAbstractMediator
-
-