Class AlarmSubscriber


  • class AlarmSubscriber
    extends java.lang.Object
    client for the Smart Home application: prints out alarm messages to the console if trigger condition in topic is detected
    Author:
    Sandro Leuchter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static double threshold
      trigger alarm if observation > threshold
    • Constructor Summary

      Constructors 
      Constructor Description
      AlarmSubscriber()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      main routine and starting point of program: subscribes to topic Conf.TOPICSTART/args[0]/args[1]/args[2] i.e.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • threshold

        static double threshold
        trigger alarm if observation > threshold
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws org.eclipse.paho.client.mqttv3.MqttException
        main routine and starting point of program: subscribes to topic Conf.TOPICSTART/args[0]/args[1]/args[2] i.e. a specific sensor and prints messages to console if observation > threshold
        Parameters:
        args - [0] floor where sensor is located
        args - [1] room where sensor is located
        args - [2] type of sensor
        args - [3] threshold
        Throws:
        org.eclipse.paho.client.mqttv3.MqttException - Paho library exceptions that have something to do with MQTT