Class Sink<S extends State>

  • Type Parameters:
    S - current state of the Sink
    All Implemented Interfaces:
    SinkListener
    Direct Known Subclasses:
    DistributedTransport, InMemorySink, LogSink

    public abstract class Sink<S extends State>
    extends Object
    implements SinkListener
    This is a Sink type. these let users to publish events according to some type. this type can either be local, jms or ws (or any custom extension)
    • Field Detail

    • Constructor Detail

      • Sink

        public Sink()
    • Method Detail

      • getSupportedInputEventClasses

        public abstract Class[] getSupportedInputEventClasses()
      • exposeServiceDeploymentInfo

        protected abstract ServiceDeploymentInfo exposeServiceDeploymentInfo()
        Give information to the deployment about the service exposed by the sink.
        Returns:
        ServiceDeploymentInfo Service related information to the deployment
      • getSupportedDynamicOptions

        public abstract String[] getSupportedDynamicOptions()
        Supported dynamic options by the transport
        Returns:
        the list of supported dynamic option keys
      • init

        protected abstract StateFactory<S> init​(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition,
                                                OptionHolder optionHolder,
                                                ConfigReader sinkConfigReader,
                                                SiddhiAppContext siddhiAppContext)
        Will be called for initialing the Sink
        Parameters:
        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.
      • publish

        public final void publish​(Object payload)
        Description copied from interface: SinkListener
        Sending events via output transport
        Specified by:
        publish in interface SinkListener
        Parameters:
        payload - payload of the event
      • disconnect

        public abstract void disconnect()
        Called after all publishing is done, or when ConnectionUnavailableException is thrown
      • destroy

        public abstract void destroy()
        Called at the end to clean all the resources consumed
      • getType

        public final String getType()
      • connectWithRetry

        public void connectWithRetry()
      • shutdown

        public void shutdown()
      • getStreamDefinition

        public io.siddhi.query.api.definition.StreamDefinition getStreamDefinition()
      • isConnected

        public boolean isConnected()
      • setConnected

        public void setConnected​(boolean connected)
      • isStateful

        public boolean isStateful()