Interface JsonChannel


  • public interface JsonChannel

    Represents a JSON channel to a subject on the Liberator.

    A Channel provides a bi-directional communication channel between a DataSource adapter and a StreamLink application. Using a Channel in both DataSource and StreamLink provides a simplified

    method of communication between the two components and can allow you just to use the Caplin platform as

    a bi-directional messaging pipe.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getSubject()
      Returns the subject name to which the channel relates.
      void send​(java.lang.Object obj)
      Sends object as JSON to the channel subject
      void sendSubjectError​(java.lang.String subject, SubjectError error)
      Sends a subject error event to the peer that opened the channel.
      void sendSubjectStatus​(java.lang.String subject, SubjectStatus subjectStatus, java.lang.String statusMessage)
      Sends a subject Status event to the peer that opened the channel.
    • Method Detail

      • getSubject

        java.lang.String getSubject()
        Returns the subject name to which the channel relates.
        Returns:
        The subject of this channel.
      • send

        void send​(java.lang.Object obj)
        Sends object as JSON to the channel subject
        Parameters:
        obj - the object to send in JSON format (using the installed JsonHandler to serialize the object to JSON)
      • sendSubjectError

        void sendSubjectError​(java.lang.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​(java.lang.String subject,
                               SubjectStatus subjectStatus,
                               java.lang.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.