Class VirtualIoTNetwork


  • public class VirtualIoTNetwork
    extends java.lang.Object
    Simulated IoT device. Keeps track of the internal state of the device
    • Constructor Detail

      • VirtualIoTNetwork

        public VirtualIoTNetwork​(NetworkSchema schema,
                                 IoTClient client)
                          throws java.lang.Exception
        Instantiate the network
        Parameters:
        schema - internal data structure of the network containing devices values and states
        client - Client between the network and the conneciton
        Throws:
        java.lang.Exception
    • Method Detail

      • updateControlState

        public void updateControlState​(StateData request)
        Updates a report state via an incoming control state request from the server. This network is designed to be an echo network, so it simply sets the report state to the value of the control state
        Parameters:
        request - update request with a state UUID and the desired value
      • updateReportState

        public void updateReportState​(StateData request)
                               throws java.lang.Exception
        Update a report state directly
        Parameters:
        request -
        Throws:
        java.lang.Exception
      • getControlStateId

        public java.util.UUID getControlStateId​(int index)
        Return the UUID of a control state from a list
        Parameters:
        index -
        Returns:
        control state UUID
      • getReportStateId

        public java.util.UUID getReportStateId​(int index)
        Return the UUID of a report state from a list
        Parameters:
        index -
        Returns:
        report state UUID
      • stop

        public void stop()
        Stop the network
      • isRunning

        public boolean isRunning()
        Check the status of the network
        Returns:
        true: network is running false: network is stopped