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 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

      void sendMessage(RecordMessage message)
      Sends a record message to the peer that opened the channel.
      Parameters:
      message - The RecordMessage 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 instead
      Sends a record message to the peer that opened the channel.
      Parameters:
      message - The RecordMessage 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 - The SubjectError 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 - The SubjectStatus to be sent.