Class DataMapperMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.wso2.carbon.mediator.datamapper.DataMapperMediator
-
- All Implemented Interfaces:
org.apache.synapse.aspects.AspectConfigurable
,org.apache.synapse.ManagedLifecycle
,org.apache.synapse.Mediator
,org.apache.synapse.SynapseArtifact
public class DataMapperMediator extends org.apache.synapse.mediators.AbstractMediator implements org.apache.synapse.ManagedLifecycle
By using the input schema, output schema and mapping configuration, DataMapperMediator generates the output required by the next mediator for the input received by the previous mediator.
-
-
Constructor Summary
Constructors Constructor Description DataMapperMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
destroy the generated unique ID for the DataMapperMediator instanceorg.apache.synapse.mediators.Value
getInputSchemaKey()
Gets the key which is used to pick the input schema from the registryString
getInputType()
Gets the input data typeorg.apache.synapse.mediators.Value
getMappingConfigurationKey()
Gets the key which is used to pick the mapping configuration from the registryorg.apache.synapse.mediators.Value
getOutputSchemaKey()
Gets the key which is used to pick the output schema from the registryString
getOutputType()
Gets the output data typeorg.apache.synapse.mediators.Value
getXsltStyleSheetKey()
void
init(org.apache.synapse.core.SynapseEnvironment se)
boolean
isContentAltering()
boolean
isContentAware()
State that DataMapperMediator interacts with the message contextboolean
mediate(org.apache.synapse.MessageContext synCtx)
Get the values from the message context to do the data mappingvoid
setInputSchemaKey(org.apache.synapse.mediators.Value dataMapperInSchemaKey)
Sets the registry key in order to pick the input schemavoid
setInputType(String type)
Sets the input data typevoid
setMappingConfigurationKey(org.apache.synapse.mediators.Value dataMapperconfigKey)
Sets the registry key in order to pick the mapping configurationvoid
setMappingResource(org.wso2.carbon.mediator.datamapper.engine.core.mapper.MappingResource mappingResource)
Set a pre-built mapping resource This method is used by data-mapper test feature in EI-Toolingvoid
setOutputSchemaKey(org.apache.synapse.mediators.Value dataMapperOutSchemaKey)
Sets the registry key in order to pick the output schemavoid
setOutputType(String type)
Sets the output data typevoid
setXsltStyleSheetKey(org.apache.synapse.mediators.Value dataMapperXsltStyleSheetKey)
Sets the registry key in order to pick the input schema-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Method Detail
-
getMappingConfigurationKey
public org.apache.synapse.mediators.Value getMappingConfigurationKey()
Gets the key which is used to pick the mapping configuration from the registry- Returns:
- the key which is used to pick the mapping configuration from the registry
-
setMappingConfigurationKey
public void setMappingConfigurationKey(org.apache.synapse.mediators.Value dataMapperconfigKey)
Sets the registry key in order to pick the mapping configuration- Parameters:
dataMapperconfigKey
- registry key for the mapping configuration
-
getInputSchemaKey
public org.apache.synapse.mediators.Value getInputSchemaKey()
Gets the key which is used to pick the input schema from the registry- Returns:
- the key which is used to pick the input schema from the registry
-
setInputSchemaKey
public void setInputSchemaKey(org.apache.synapse.mediators.Value dataMapperInSchemaKey)
Sets the registry key in order to pick the input schema- Parameters:
dataMapperInSchemaKey
- registry key for the input schema
-
setXsltStyleSheetKey
public void setXsltStyleSheetKey(org.apache.synapse.mediators.Value dataMapperXsltStyleSheetKey)
Sets the registry key in order to pick the input schema- Parameters:
dataMapperXsltStyleSheetKey
- registry key for the input schema
-
getXsltStyleSheetKey
public org.apache.synapse.mediators.Value getXsltStyleSheetKey()
- Returns:
- dataMapperXsltStyleSheetKey registry key for the input schema
-
getOutputSchemaKey
public org.apache.synapse.mediators.Value getOutputSchemaKey()
Gets the key which is used to pick the output schema from the registry- Returns:
- the key which is used to pick the output schema from the registry
-
setOutputSchemaKey
public void setOutputSchemaKey(org.apache.synapse.mediators.Value dataMapperOutSchemaKey)
Sets the registry key in order to pick the output schema- Parameters:
dataMapperOutSchemaKey
- registry key for the output schema
-
getInputType
public String getInputType()
Gets the input data type- Overrides:
getInputType
in classorg.apache.synapse.mediators.AbstractMediator
- Returns:
- the input data type
-
setInputType
public void setInputType(String type)
Sets the input data type- Parameters:
type
- the input data type
-
getOutputType
public String getOutputType()
Gets the output data type- Overrides:
getOutputType
in classorg.apache.synapse.mediators.AbstractMediator
- Returns:
- the output data type
-
setOutputType
public void setOutputType(String type)
Sets the output data type- Parameters:
type
- the output data type
-
setMappingResource
public void setMappingResource(org.wso2.carbon.mediator.datamapper.engine.core.mapper.MappingResource mappingResource)
Set a pre-built mapping resource This method is used by data-mapper test feature in EI-Tooling- Parameters:
mappingResource
- prebuilt mapping resource
-
mediate
public boolean mediate(org.apache.synapse.MessageContext synCtx)
Get the values from the message context to do the data mapping- Specified by:
mediate
in interfaceorg.apache.synapse.Mediator
- Parameters:
synCtx
- current message for the mediation- Returns:
- true if mediation happened successfully else false.
-
isContentAware
public boolean isContentAware()
State that DataMapperMediator interacts with the message context- Specified by:
isContentAware
in interfaceorg.apache.synapse.Mediator
- Overrides:
isContentAware
in classorg.apache.synapse.mediators.AbstractMediator
- Returns:
- true if the DataMapperMediator is intending to interact with the message context
-
isContentAltering
public boolean isContentAltering()
- Specified by:
isContentAltering
in interfaceorg.apache.synapse.Mediator
- Overrides:
isContentAltering
in classorg.apache.synapse.mediators.AbstractMediator
-
init
public void init(org.apache.synapse.core.SynapseEnvironment se)
- Specified by:
init
in interfaceorg.apache.synapse.ManagedLifecycle
-
destroy
public void destroy()
destroy the generated unique ID for the DataMapperMediator instance- Specified by:
destroy
in interfaceorg.apache.synapse.ManagedLifecycle
-
-