Class 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.
    • Field Summary

      • Fields inherited from class org.apache.synapse.mediators.AbstractMediator

        trace, traceState
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      destroy the generated unique ID for the DataMapperMediator instance
      org.apache.synapse.mediators.Value getInputSchemaKey()
      Gets the key which is used to pick the input schema from the registry
      String getInputType()
      Gets the input data type
      org.apache.synapse.mediators.Value getMappingConfigurationKey()
      Gets the key which is used to pick the mapping configuration from the registry
      org.apache.synapse.mediators.Value getOutputSchemaKey()
      Gets the key which is used to pick the output schema from the registry
      String getOutputType()
      Gets the output data type
      org.apache.synapse.mediators.Value getXsltStyleSheetKey()  
      void init​(org.apache.synapse.core.SynapseEnvironment se)  
      boolean isContentAltering()  
      boolean isContentAware()
      State that DataMapperMediator interacts with the message context
      boolean mediate​(org.apache.synapse.MessageContext synCtx)
      Get the values from the message context to do the data mapping
      void setInputSchemaKey​(org.apache.synapse.mediators.Value dataMapperInSchemaKey)
      Sets the registry key in order to pick the input schema
      void setInputType​(String type)
      Sets the input data type
      void setMappingConfigurationKey​(org.apache.synapse.mediators.Value dataMapperconfigKey)
      Sets the registry key in order to pick the mapping configuration
      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
      void setOutputSchemaKey​(org.apache.synapse.mediators.Value dataMapperOutSchemaKey)
      Sets the registry key in order to pick the output schema
      void setOutputType​(String type)
      Sets the output data type
      void 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
    • Constructor Detail

      • DataMapperMediator

        public DataMapperMediator()
    • 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 class org.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 class org.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 interface org.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 interface org.apache.synapse.Mediator
        Overrides:
        isContentAware in class org.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 interface org.apache.synapse.Mediator
        Overrides:
        isContentAltering in class org.apache.synapse.mediators.AbstractMediator
      • init

        public void init​(org.apache.synapse.core.SynapseEnvironment se)
        Specified by:
        init in interface org.apache.synapse.ManagedLifecycle
      • destroy

        public void destroy()
        destroy the generated unique ID for the DataMapperMediator instance
        Specified by:
        destroy in interface org.apache.synapse.ManagedLifecycle