public class TwitterSource
extends org.wso2.siddhi.core.stream.input.source.Source
| Constructor and Description |
|---|
TwitterSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(org.wso2.siddhi.core.stream.input.source.Source.ConnectionCallback connectionCallback)
Initially Called to connect to the end point for start retrieving the messages asynchronously .
|
Map<String,Object> |
currentState()
Used to collect the serializable state of the processing element, that need to be
persisted for the reconstructing the element to the same state on a different point of time
|
void |
destroy()
Called at the end to clean all the resources consumed by the
Source |
void |
disconnect()
This method can be called when it is needed to disconnect from the end point.
|
Class[] |
getOutputEventClasses()
Returns the list of classes which this source can output.
|
void |
init(org.wso2.siddhi.core.stream.input.source.SourceEventListener sourceEventListener,
org.wso2.siddhi.core.util.transport.OptionHolder optionHolder,
String[] requestedTransportPropertyNames,
org.wso2.siddhi.core.util.config.ConfigReader configReader,
org.wso2.siddhi.core.config.SiddhiAppContext siddhiAppContext)
The initialization method for
Source, will be called before other methods. |
void |
pause()
Called to pause event consumption
|
void |
restoreState(Map<String,Object> map)
Used to restore serialized state of the processing element, for reconstructing
the element to the same state as if was on a previous point of time.
|
void |
resume()
Called to resume event consumption
|
public void init(org.wso2.siddhi.core.stream.input.source.SourceEventListener sourceEventListener,
org.wso2.siddhi.core.util.transport.OptionHolder optionHolder,
String[] requestedTransportPropertyNames,
org.wso2.siddhi.core.util.config.ConfigReader configReader,
org.wso2.siddhi.core.config.SiddhiAppContext siddhiAppContext)
Source, will be called before other methods. It used to validate
all configurations and to get initial values.init in class org.wso2.siddhi.core.stream.input.source.SourcesourceEventListener - After receiving events, the source should trigger onEvent() of this listener.
Listener will then pass on the events to the appropriate mappers for processing .optionHolder - Option holder containing static configuration related to the SourceconfigReader - ConfigReader is used to read the Source related system configuration.siddhiAppContext - the context of the SiddhiApp used to get Siddhi
related utility functions.public Class[] getOutputEventClasses()
getOutputEventClasses in class org.wso2.siddhi.core.stream.input.source.Sourcepublic void connect(org.wso2.siddhi.core.stream.input.source.Source.ConnectionCallback connectionCallback)
throws org.wso2.siddhi.core.exception.ConnectionUnavailableException
connect in class org.wso2.siddhi.core.stream.input.source.SourceconnectionCallback - Callback to pass the ConnectionUnavailableException in case of connection failure after
initial successful connection. (can be used when events are receiving asynchronously)org.wso2.siddhi.core.exception.ConnectionUnavailableException - if it cannot connect to the source backend immediately.public void disconnect()
disconnect in class org.wso2.siddhi.core.stream.input.source.Sourcepublic void destroy()
Sourcedestroy in class org.wso2.siddhi.core.stream.input.source.Sourcepublic void pause()
pause in class org.wso2.siddhi.core.stream.input.source.Sourcepublic void resume()
resume in class org.wso2.siddhi.core.stream.input.source.Sourcepublic Map<String,Object> currentState()
public void restoreState(Map<String,Object> map)
map - the stateful objects of the processing element as a map.
This map will have the same keys that is created upon calling currentState() method.Copyright © 2018 WSO2. All rights reserved.