public class BinaryPassThroughSourceMapper
extends io.siddhi.core.stream.input.source.SourceMapper
eg:-
@Extension(
name = "The name of the extension",
namespace = "The namespace of the extension",
description = "The description of the extension (optional).",
//Source Mapper configurations
parameters = {
@Parameter(name = "The name of the first parameter",
description= "The description of the first parameter",
type = "Supported parameter types.
eg:{DataType.STRING, DataType.INT, DataType.LONG etc}",
dynamic= "false
(if parameter doesn't depend on each event then dynamic parameter is false.
In Source, only use static parameter)",
optional= "true/false, defaultValue= if it is optional then assign a default value
according to the type."),
@Parameter(name = "The name of the second parameter",
description= "The description of the second parameter",
type = "Supported parameter types.
eg:{DataType.STRING, DataType.INT, DataType.LONG etc}",
dynamic= "false
(if parameter doesn't depend on each event then dynamic parameter is false.
In Source, only use static parameter)",
optional= "true/false, defaultValue= if it is optional then assign a default value
according to the type."),
},
//If Source Mapper system configurations will need then
systemParameters = {
@SystemParameter(name = "The name of the first system parameter",
description="The description of the first system parameter." ,
defaultValue = "the default value of the system parameter.",
possibleParameter="the possible value of the system parameter.",
),
},
examples = {
@Example(syntax = "sample query with Source Mapper annotation that explain how extension use in Siddhi."
description =" The description of the given example's query."
),
}
)
| Constructor and Description |
|---|
BinaryPassThroughSourceMapper() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowNullInTransportProperties()
Method used by
SourceMapper to determine on how to handle transport properties with null values. |
Class[] |
getSupportedInputEventClasses()
Returns the list of classes which this source can output.
|
void |
init(io.siddhi.query.api.definition.StreamDefinition streamDefinition,
io.siddhi.core.util.transport.OptionHolder optionHolder,
List<io.siddhi.core.stream.input.source.AttributeMapping> attributeMappingList,
io.siddhi.core.util.config.ConfigReader configReader,
io.siddhi.core.config.SiddhiAppContext siddhiAppContext)
The initialization method for
SourceMapper, which will be called before other methods and validate
the all configuration and getting the initial values. |
protected void |
mapAndProcess(Object eventObject,
io.siddhi.core.stream.input.source.InputEventHandler inputEventHandler)
Method to map the incoming event and as pass that via inputEventHandler to process further.
|
public void init(io.siddhi.query.api.definition.StreamDefinition streamDefinition,
io.siddhi.core.util.transport.OptionHolder optionHolder,
List<io.siddhi.core.stream.input.source.AttributeMapping> attributeMappingList,
io.siddhi.core.util.config.ConfigReader configReader,
io.siddhi.core.config.SiddhiAppContext siddhiAppContext)
SourceMapper, which will be called before other methods and validate
the all configuration and getting the initial values.init in class io.siddhi.core.stream.input.source.SourceMapperstreamDefinition - Associated output stream definitionoptionHolder - Option holder containing static configuration related to the SourceMapperattributeMappingList - Custom attribute mapping for source-mappingconfigReader - to read the SourceMapper related system configuration.siddhiAppContext - the context of the SiddhiApp used to get siddhipublic Class[] getSupportedInputEventClasses()
getSupportedInputEventClasses in class io.siddhi.core.stream.input.source.SourceMapperprotected void mapAndProcess(Object eventObject, io.siddhi.core.stream.input.source.InputEventHandler inputEventHandler) throws InterruptedException
mapAndProcess in class io.siddhi.core.stream.input.source.SourceMappereventObject - Incoming event Object based on the supported event class imported by the extensions.inputEventHandler - Handler to pass the converted Siddhi Event for processingInterruptedException - if it does not throw the exception immediately due to streamingprotected boolean allowNullInTransportProperties()
SourceMapper to determine on how to handle transport properties with null values. If
this returns 'false' then SourceMapper will drop any event/s with null transport
property values. If this returns
'true' then SourceMapper will send events even though they contains null transport properties.
This method will be called after init().allowNullInTransportProperties in class io.siddhi.core.stream.input.source.SourceMapperSourceMapper should allow or drop events when transport properties are null.Copyright © 2021 WSO2. All rights reserved.