Package com.caplin.datasource.channel
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 TypeMethodDescriptionvoid
onChannelClose
(JsonChannel jsonChannel) Callback that informs theJsonChannelListener
that a StreamLink client wishes to close a channel.boolean
onChannelOpen
(JsonChannel jsonChannel) Callback that informs theJsonChannelListener
that a StreamLink client wishes to open a channel.void
onMessageReceived
(JsonChannel jsonChannel, JsonChannelMessage jsonMessage) Callback that informs theJsonChannelListener
that a StreamLink client has sent a message to the DataSource via a specified channel.
-
Method Details
-
onChannelOpen
Callback that informs the
JsonChannelListener
that a StreamLink client wishes to open a channel.- Parameters:
jsonChannel
- The channel to be opened.
-
onChannelClose
Callback that informs the
JsonChannelListener
that a StreamLink client wishes to close a channel.- Parameters:
jsonChannel
- The channel to be closed.
-
onMessageReceived
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.
-