Interface JsonChannelListener


public interface JsonChannelListener

Interface that must be implemented in order to perform bi-directional communication with a StreamLink client.

 

The following example shows a basic implementation of JsonChannelListener that accepts all jsonChannels within a namespace and echoes incoming messages back to the StreamLink client:

 

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Callback that informs the JsonChannelListener that a StreamLink client wishes to close a channel.
    boolean
    Callback that informs the JsonChannelListener that a StreamLink client wishes to open a channel.
    void
    Callback that informs the JsonChannelListener that a StreamLink client has sent a message to the DataSource via a specified channel.
  • Method Details

    • onChannelOpen

      boolean onChannelOpen(JsonChannel jsonChannel)

      Callback that informs the JsonChannelListener that a StreamLink client wishes to open a channel.

      Parameters:
      jsonChannel - The channel to be opened.
    • onChannelClose

      void onChannelClose(JsonChannel jsonChannel)

      Callback that informs the JsonChannelListener that a StreamLink client wishes to close a channel.

      Parameters:
      jsonChannel - The channel to be closed.
    • onMessageReceived

      void onMessageReceived(JsonChannel jsonChannel, JsonChannelMessage jsonMessage)

      Callback that informs the JsonChannelListener that a StreamLink client has sent a message to the DataSource via a specified channel.

      Parameters:
      jsonChannel - The channel receiving the message.
      jsonMessage - A message containing fields that have been sent to the DataSource by the StreamLink client.