Package com.caplin.datasource.channel
Interface Channel
public interface Channel
Channels provide a bi-directional communication mechanism between StreamLink clients and DataSource
applications. Messages on a channel take the form of RecordMessages
that can be sent by either the DataSource or the StreamLink client. An example use of Channel would be
to implement a trade messaging channel.
A channel is identified by its subject and the DataSource Peer (for example, a
Liberator) that opened the channel. In deployment, this means that it is possible for two channels to exist with
identical subjects but they are differentiated by the Peers that opened them.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a Generic Message with the subject of this channel.Creates a type 1 record message with the subject of this channel.getPeer()Gets the peer that opened the channel.Gets the subject of this channel.voidsendMessage(RecordMessage message) Sends a record message to the peer that opened the channel.voidsendRecordMessage(RecordMessage message) Deprecated.use sendMessage insteadvoidsendSubjectError(String subject, SubjectError error) Sends a subject error event to the peer that opened the channel.voidsendSubjectStatus(String subject, SubjectStatus subjectStatus, String statusMessage) Sends a subject Status event to the peer that opened the channel.
-
Method Details
-
getSubject
String getSubject()Gets the subject of this channel.- Returns:
- The subject.
-
getPeer
Peer getPeer()Gets the peer that opened the channel.- Returns:
- The peer.
-
createMessage
GenericMessage createMessage()Creates a Generic Message with the subject of this channel.- Returns:
- The new
GenericMessage.
-
sendMessage
Sends a record message to the peer that opened the channel.- Parameters:
message- TheRecordMessageto be sent.
-
createRecordMessage
RecordType1Message createRecordMessage()Creates a type 1 record message with the subject of this channel.- Returns:
- The new
RecordType1Message.
-
sendRecordMessage
Deprecated.use sendMessage insteadSends a record message to the peer that opened the channel.- Parameters:
message- TheRecordMessageto be sent.
-
sendSubjectError
Sends a subject error event to the peer that opened the channel.- Parameters:
subject- The subject to send the subject error to.error- TheSubjectErrorto be sent.
-
sendSubjectStatus
Sends a subject Status event to the peer that opened the channel.- Parameters:
subject- The subject to send the subject error to.statusMessage- The statusMessage to send to the peer.subjectStatus- TheSubjectStatusto be sent.
-