Class RpcClient

  • All Implemented Interfaces:
    IoTClient

    public class RpcClient
    extends java.lang.Object
    implements IoTClient
    Responsible for mediating messages between the server connection and the simulated Iot network
    • Constructor Summary

      Constructors 
      Constructor Description
      RpcClient​(Connection conn)
      Instantiate client with a connection
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void send​(java.lang.String message)
      Send message to the server
      void start​(RpcParser parser)
      Starts the connection and sets the parser for incoming data
      void stop()
      Close the connection to the server
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RpcClient

        public RpcClient​(Connection conn)
        Instantiate client with a connection
        Parameters:
        conn - connection to the server
    • Method Detail

      • start

        public void start​(RpcParser parser)
                   throws java.lang.Exception
        Starts the connection and sets the parser for incoming data
        Specified by:
        start in interface IoTClient
        Parameters:
        parser - parses incoming JSON-RPC into commands
        Throws:
        java.lang.Exception
      • send

        public void send​(java.lang.String message)
        Send message to the server
        Specified by:
        send in interface IoTClient
        Parameters:
        message -
      • stop

        public void stop()
        Close the connection to the server
        Specified by:
        stop in interface IoTClient