public class MappingHandler extends Object implements InputVariableNotifier, OutputVariableNotifier
Constructor and Description |
---|
MappingHandler(MappingResource mappingResource,
String inputType,
String outputType,
String dmExecutorPoolSize) |
Modifier and Type | Method and 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) |
public MappingHandler(MappingResource mappingResource, String inputType, String outputType, String dmExecutorPoolSize) throws IOException, SchemaException, WriterException
public String doMap(InputStream inputMsg, Map<String,Map<String,Object>> propertiesMap) throws ReaderException, InterruptedException, IOException, SchemaException, JSException
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.
inputMsg
- Input message as an InputStreampropertiesMap
- Map of maps, single map for each scopeReaderException
InterruptedException
IOException
SchemaException
JSException
public void notifyInputVariable(Object variable) throws SchemaException, JSException, ReaderException
notifyInputVariable
in interface InputVariableNotifier
SchemaException
JSException
ReaderException
public void notifyOutputVariable(Object variable)
notifyOutputVariable
in interface OutputVariableNotifier
Copyright © 2018 WSO2. All rights reserved.