public class LogSink extends Sink
Sink
which can be used as a logger. This will log the output events in the output stream
with user specified priority and a prefixSink.OnErrorAction
isTryingToConnect
Constructor and Description |
---|
LogSink() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Called to connect to the backend before events are published
|
void |
destroy()
Called at the end to clean all the resources consumed
|
void |
disconnect()
Called after all publishing is done, or when ConnectionUnavailableException is thrown
|
String[] |
getSupportedDynamicOptions()
Supported dynamic options by the transport
|
Class[] |
getSupportedInputEventClasses() |
protected void |
init(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition,
OptionHolder optionHolder,
ConfigReader sinkConfigReader,
SiddhiAppContext siddhiAppContext)
Will be called for initialing the
Sink |
void |
publish(Object payload,
DynamicOptions transportOptions)
Sending events via output transport
|
connectWithRetry, getHandler, getMapper, getStreamDefinition, getType, init, initOnlyTransport, isConnected, publish, setConnected, shutdown
public Class[] getSupportedInputEventClasses()
getSupportedInputEventClasses
in class Sink
public String[] getSupportedDynamicOptions()
Sink
getSupportedDynamicOptions
in class Sink
protected void init(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition, OptionHolder optionHolder, ConfigReader sinkConfigReader, SiddhiAppContext siddhiAppContext)
Sink
Sink
init
in class Sink
outputStreamDefinition
- containing stream definition bind to the Sink
optionHolder
- Option holder containing static and dynamic options related to the Sink
sinkConfigReader
- this hold the Sink
extensions configuration reader.siddhiAppContext
- SiddhiAppContext
of the parent siddhi app.public void publish(Object payload, DynamicOptions transportOptions) throws ConnectionUnavailableException
Sink
publish
in class Sink
payload
- payload of the eventtransportOptions
- one of the event constructing the payloadConnectionUnavailableException
- throw when connections are unavailable.public void connect() throws ConnectionUnavailableException
Sink
connect
in class Sink
ConnectionUnavailableException
- if it cannot connect to the backendpublic void disconnect()
Sink
disconnect
in class Sink
Copyright © 2019. All rights reserved.