Package org.apache.synapse
Interface Mediator
-
- All Superinterfaces:
SynapseArtifact
- All Known Subinterfaces:
FilterMediator
,ListMediator
- All Known Implementing Classes:
AbstractDBMediator
,AbstractListMediator
,AbstractMediator
,AggregateMediator
,AnnotatedCommandMediator
,AnonymousListMediator
,BeanMediator
,CallMediator
,CalloutMediator
,ClassMediator
,CloneMediator
,CommentMediator
,ConditionalRouterMediator
,DBLookupMediator
,DBReportMediator
,DropMediator
,EJBMediator
,EnqueueMediator
,EnrichMediator
,EventPublisherMediator
,FaultMediator
,FilterMediator
,ForEachMediator
,HeaderMediator
,InMediator
,InvokeMediator
,IterateMediator
,JSONTransformMediator
,LogMediator
,LoopBackMediator
,MessageStoreMediator
,NTLMMediator
,OutMediator
,PayloadFactoryMediator
,POJOCommandMediator
,PropertyGroupMediator
,PropertyMediator
,RespondMediator
,SamplingThrottleMediator
,SendMediator
,SequenceMediator
,SwitchMediator
,SynapseMediator
,TemplateMediator
,TransactionMediator
,URLRewriteMediator
,ValidateMediator
,XSLTMediator
public interface Mediator extends SynapseArtifact
All Synapse mediators must implement this Mediator interface. As a message passes through the Synapse system, each mediator's mediate() method is invoked in the sequence/order defined in the SynapseConfiguration.It is recommended to extend the abstract class
AbstractMediator
or theAbstractListMediator
as appropriate instead of directly implementing this interface- See Also:
AbstractMediator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getMediatorName()
Returns name of the mediator class.int
getMediatorPosition()
Get the position of the mediator in sequence flow.String
getShortDescription()
Retrieves the short description of the mediatorint
getTraceState()
This is used to check whether the tracing should be enabled on the current mediator or notString
getType()
This is used for debugging purposes and exposes the type of the current mediator for logging and debugging purposesboolean
isContentAltering()
This is used to indicate whether message payload get modified during mediationboolean
isContentAware()
boolean
mediate(MessageContext synCtx)
Invokes the mediator passing the current message for mediation.void
reportCloseStatistics(MessageContext synCtx, Integer currentIndex)
Report Close Statistic Event for the MediatorInteger
reportOpenStatistics(MessageContext synCtx, boolean isContentAltering)
Report Open Statistic Event for the Mediatorvoid
setComponentStatisticsId(ArtifactHolder holder)
void
setMediatorPosition(int position)
Set the position of the mediator in the sequencevoid
setShortDescription(String shortDescription)
Set the short description of the mediatorvoid
setTraceState(int traceState)
This is used to set the value of tracing enable variable-
Methods inherited from interface org.apache.synapse.SynapseArtifact
getDescription, setDescription
-
-
-
-
Method Detail
-
mediate
boolean mediate(MessageContext synCtx)
Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.- Parameters:
synCtx
- the current message for mediation- Returns:
- true if further mediation should continue
-
getType
String getType()
This is used for debugging purposes and exposes the type of the current mediator for logging and debugging purposes- Returns:
- a String representation of the mediator type
-
getTraceState
int getTraceState()
This is used to check whether the tracing should be enabled on the current mediator or not- Returns:
- value that indicate whether tracing is on, off or unset
-
setTraceState
void setTraceState(int traceState)
This is used to set the value of tracing enable variable- Parameters:
traceState
- Set whether the tracing is enabled or not
-
isContentAware
boolean isContentAware()
-
isContentAltering
boolean isContentAltering()
This is used to indicate whether message payload get modified during mediation- Returns:
- whether mediator modify the payload
-
getMediatorPosition
int getMediatorPosition()
Get the position of the mediator in sequence flow.- Returns:
- position of the mediator in sequence
-
setMediatorPosition
void setMediatorPosition(int position)
Set the position of the mediator in the sequence- Parameters:
position
- position
-
setShortDescription
void setShortDescription(String shortDescription)
Set the short description of the mediator- Parameters:
shortDescription
- to be set to the artifact
-
getShortDescription
String getShortDescription()
Retrieves the short description of the mediator- Returns:
- short description of the artifact
-
getMediatorName
String getMediatorName()
Returns name of the mediator class. This was introduced due to that getType is not uniquely implemented for all mediators to get the name.- Returns:
- a String of the mediator class name
-
reportOpenStatistics
Integer reportOpenStatistics(MessageContext synCtx, boolean isContentAltering)
Report Open Statistic Event for the Mediator
-
reportCloseStatistics
void reportCloseStatistics(MessageContext synCtx, Integer currentIndex)
Report Close Statistic Event for the Mediator
-
setComponentStatisticsId
void setComponentStatisticsId(ArtifactHolder holder)
-
-