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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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 Detail
-
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.
-
-