DataSource.NET  7.1.32.168791-9652659d
Caplin.DataSource.Channel.IChannelListener Interface Reference

More...

Public Member Functions

void ChannelClosed (IChannel channel)
 Callback that informs the IChannelListener that a StreamLink client wishes to close a channel. More...
 
bool ChannelOpened (IChannel channel)
 Callback that informs the ChannelListener that a StreamLink client wishes to open a channel. More...
 
void MessageReceived (IChannel channel, IRecordMessage recordMessage)
 Callback that informs the IChannelListener that a StreamLink client has sent a message to the DataSource via a specified channel. More...
 

Detailed Description

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

Member Function Documentation

void Caplin.DataSource.Channel.IChannelListener.ChannelClosed ( IChannel  channel)

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

Parameters
channelThe channel to be closed.
bool Caplin.DataSource.Channel.IChannelListener.ChannelOpened ( IChannel  channel)

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

If you return true DataSource for Java will send an empty placeholder record back to the StreamLink client for the channel subject. The StreamLink client can then contribute fields to this record in order to send a message to the DataSource.

If you return false DataSource for Java will send a Caplin.DataSource.ISubjectErrorEvent back to the StreamLink client for the channel subject, with an error of Caplin.DataSource.SubjectError.NotFound. This indicates to the StreamLink client that the channel was rejected by the DataSource.

Your IChannelListener should decide whether to accept the channel based on the channel subject, which can be retrieved by calling IChannel.Subject. This subject should contain all of the information needed for the DataSource to establish a channel. For example, if you are creating a trading application, the channel subject could contain the username of the StreamLink client and an asset class that the user wants to trade, for example:

/CHANNEL/FX/user1

If the channel subject is correctly formed, as in the example above, you should return true. If the subject does not contain all of the required information, or the information is invalid, you should return false.

Parameters
channelThe channel to be opened.
Returns
A boolean denoting whether the IChannelListener accepts the channel.
void Caplin.DataSource.Channel.IChannelListener.MessageReceived ( IChannel  channel,
IRecordMessage  recordMessage 
)

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

Parameters
channelThe channel receiving the message.
recordMessageA message containing fields that have been sent to the DataSource by the StreamLink client.

Generated on Wed Oct 18 2023 17:20:25 for DataSource.NET