Package com.caplin.datasource.channel
Interface Channel
-
public interface Channel
Channel
s provide a bi-directional communication mechanism between StreamLink clients and DataSource applications. Messages on a channel take the form ofRecordMessage
s that can be sent by either the DataSource or the StreamLink client. An example use ofChannel
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 thePeer
s that opened them.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description GenericMessage
createMessage()
Creates a Generic Message with the subject of this channel.RecordType1Message
createRecordMessage()
Creates a type 1 record message with the subject of this channel.Peer
getPeer()
Gets the peer that opened the channel.String
getSubject()
Gets the subject of this channel.void
sendMessage(RecordMessage message)
Sends a record message to the peer that opened the channel.void
sendRecordMessage(RecordMessage message)
Deprecated.use sendMessage insteadvoid
sendSubjectError(String subject, SubjectError error)
Sends a subject error event to the peer that opened the channel.void
sendSubjectStatus(String subject, SubjectStatus subjectStatus, String statusMessage)
Sends a subject Status event to the peer that opened the channel.
-
-
-
Method Detail
-
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
void sendMessage(RecordMessage message)
Sends a record message to the peer that opened the channel.- Parameters:
message
- TheRecordMessage
to be sent.
-
createRecordMessage
RecordType1Message createRecordMessage()
Creates a type 1 record message with the subject of this channel.- Returns:
- The new
RecordType1Message
.
-
sendRecordMessage
@Deprecated void sendRecordMessage(RecordMessage message)
Deprecated.use sendMessage insteadSends a record message to the peer that opened the channel.- Parameters:
message
- TheRecordMessage
to be sent.
-
sendSubjectError
void sendSubjectError(String subject, SubjectError error)
Sends a subject error event to the peer that opened the channel.- Parameters:
subject
- The subject to send the subject error to.error
- TheSubjectError
to be sent.
-
sendSubjectStatus
void sendSubjectStatus(String subject, SubjectStatus subjectStatus, String statusMessage)
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
- TheSubjectStatus
to be sent.
-
-