DataSource.NET
7.1.2.311419
|
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... | |
Interface that must be implemented in order to perform bi-directional communication with a StreamLink client.
void Caplin.DataSource.Channel.IChannelListener.ChannelClosed | ( | IChannel | channel | ) |
Callback that informs the IChannelListener that a StreamLink client wishes to close a channel.
channel | The 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.
channel | The channel to be opened. |
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.
channel | The channel receiving the message. |
recordMessage | A message containing fields that have been sent to the DataSource by the StreamLink client. |