Class MappingHandler
- java.lang.Object
-
- org.wso2.carbon.mediator.datamapper.engine.core.mapper.MappingHandler
-
- All Implemented Interfaces:
InputVariableNotifier
,OutputVariableNotifier
public class MappingHandler extends Object implements InputVariableNotifier, OutputVariableNotifier
-
-
Constructor Summary
Constructors Constructor Description MappingHandler(MappingResource mappingResource, String inputType, String outputType, String dmExecutorPoolSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
doMap(InputStream inputMsg, Map<String,Map<String,Object>> propertiesMap)
This method performs the mapping from input message to the specified output schema.void
notifyInputVariable(Object variable)
void
notifyOutputVariable(Object variable)
-
-
-
Constructor Detail
-
MappingHandler
public MappingHandler(MappingResource mappingResource, String inputType, String outputType, String dmExecutorPoolSize) throws IOException, SchemaException, WriterException
-
-
Method Detail
-
doMap
public String doMap(InputStream inputMsg, Map<String,Map<String,Object>> propertiesMap) throws ReaderException, InterruptedException, IOException, SchemaException, JSException
This method performs the mapping from input message to the specified output schema.Input message should be passed as an InputStream and any runtime properties can be passed as a Map. At the top level of the Properties map, it contains scope name (String) and an individual map for each scope. In the next level, a map in a single scope should contain name, value pairs for each property name and its value.
Map of maps will be converted to a JSON object to be injected to the JavaScript processing engine.
- Parameters:
inputMsg
- Input message as an InputStreampropertiesMap
- Map of maps, single map for each scope- Returns:
- Output message created according to the provided OutputSchema using the runtime arguments
- Throws:
ReaderException
InterruptedException
IOException
SchemaException
JSException
-
notifyInputVariable
public void notifyInputVariable(Object variable) throws SchemaException, JSException, ReaderException
- Specified by:
notifyInputVariable
in interfaceInputVariableNotifier
- Throws:
SchemaException
JSException
ReaderException
-
notifyOutputVariable
public void notifyOutputVariable(Object variable)
- Specified by:
notifyOutputVariable
in interfaceOutputVariableNotifier
-
-