Class SourceMapper
- java.lang.Object
-
- io.siddhi.core.stream.input.source.SourceMapper
-
- All Implemented Interfaces:
SourceEventListener
- Direct Known Subclasses:
PassThroughSourceMapper
public abstract class SourceMapper extends Object implements SourceEventListener
Convert custom input fromSourcetoComplexEventChunk.
-
-
Field Summary
Fields Modifier and Type Field Description protected OptionHoldersourceOptionHolderprotected StringsourceType
-
Constructor Summary
Constructors Constructor Description SourceMapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleanallowNullInTransportProperties()Method used bySourceMapperto determine on how to handle transport properties with null values.longgetEventCount()SourceHandlergetHandler()io.siddhi.query.api.definition.StreamDefinitiongetStreamDefinition()abstract Class[]getSupportedInputEventClasses()Support classes that the source-mapper can consume for mapping processing (used for validation purposes)abstract voidinit(io.siddhi.query.api.definition.StreamDefinition streamDefinition, OptionHolder optionHolder, List<AttributeMapping> attributeMappingList, ConfigReader configReader, SiddhiAppContext siddhiAppContext)Initialize Source-mappervoidinit(io.siddhi.query.api.definition.StreamDefinition streamDefinition, String mapType, OptionHolder mapOptionHolder, List<AttributeMapping> attributeMappings, String sourceType, SourceSyncCallback sourceSyncCallback, List<AttributeMapping> transportMappings, SourceHandler sourceHandler, OptionHolder sourceOptionHolder, ConfigReader configReader, SiddhiAppContext siddhiAppContext)protected abstract voidmapAndProcess(Object eventObject, InputEventHandler inputEventHandler)Method to map the incoming event and as pass that via inputEventHandler to process further.voidonEvent(Object eventObject, Object[] transportProperties)voidonEvent(Object eventObject, Object[] transportProperties, String[] transportSyncProperties)voidonEvent(Object eventObject, String[] transportProperties)voidonEvent(Object eventObject, String[] transportProperties, String[] transportSyncProperties)voidsetInputHandler(InputHandler inputHandler)
-
-
-
Field Detail
-
sourceType
protected String sourceType
-
sourceOptionHolder
protected OptionHolder sourceOptionHolder
-
-
Method Detail
-
init
public final void init(io.siddhi.query.api.definition.StreamDefinition streamDefinition, String mapType, OptionHolder mapOptionHolder, List<AttributeMapping> attributeMappings, String sourceType, SourceSyncCallback sourceSyncCallback, List<AttributeMapping> transportMappings, SourceHandler sourceHandler, OptionHolder sourceOptionHolder, ConfigReader configReader, SiddhiAppContext siddhiAppContext)
-
init
public abstract void init(io.siddhi.query.api.definition.StreamDefinition streamDefinition, OptionHolder optionHolder, List<AttributeMapping> attributeMappingList, ConfigReader configReader, SiddhiAppContext siddhiAppContext)Initialize Source-mapper- Parameters:
streamDefinition- Associated output stream definitionoptionHolder- Mapper option holderattributeMappingList- Custom attribute mapping for source-mappingconfigReader- System configuration readersiddhiAppContext- Siddhi application context
-
getSupportedInputEventClasses
public abstract Class[] getSupportedInputEventClasses()
Support classes that the source-mapper can consume for mapping processing (used for validation purposes)- Returns:
- Supported event classes that mapper can process.
-
setInputHandler
public final void setInputHandler(InputHandler inputHandler)
-
onEvent
public final void onEvent(Object eventObject, String[] transportProperties)
- Specified by:
onEventin interfaceSourceEventListener
-
onEvent
public final void onEvent(Object eventObject, Object[] transportProperties)
- Specified by:
onEventin interfaceSourceEventListener
-
onEvent
public final void onEvent(Object eventObject, String[] transportProperties, String[] transportSyncProperties)
- Specified by:
onEventin interfaceSourceEventListener
-
onEvent
public final void onEvent(Object eventObject, Object[] transportProperties, String[] transportSyncProperties)
- Specified by:
onEventin interfaceSourceEventListener
-
getHandler
public SourceHandler getHandler()
-
getStreamDefinition
public final io.siddhi.query.api.definition.StreamDefinition getStreamDefinition()
- Specified by:
getStreamDefinitionin interfaceSourceEventListener
-
getEventCount
public long getEventCount()
-
mapAndProcess
protected abstract void mapAndProcess(Object eventObject, InputEventHandler inputEventHandler) throws MappingFailedException, InterruptedException
Method to map the incoming event and as pass that via inputEventHandler to process further.- Parameters:
eventObject- Incoming event ObjectinputEventHandler- Handler to pass the converted Siddhi Event for processing- Throws:
MappingFailedException- Throws MappingFailedExceptionInterruptedException- Throws InterruptedException
-
allowNullInTransportProperties
protected abstract boolean allowNullInTransportProperties()
Method used bySourceMapperto determine on how to handle transport properties with null values. If this returns 'false' thenSourceMapperwill drop any event/s with null transport property values. If this returns 'true' thenSourceMapperwill send events even though they contains null transport properties. This method will be called after init().- Returns:
- whether
SourceMappershould allow or drop events when transport properties are null.
-
-