Class MqttWesClient

java.lang.Object
org.rockhopper.smarthome.wes.wes2mqtt.MqttWesClient
All Implemented Interfaces:
org.eclipse.paho.client.mqttv3.MqttCallback, WesEventListener, org.springframework.beans.factory.DisposableBean

@Component public class MqttWesClient extends Object implements WesEventListener, org.eclipse.paho.client.mqttv3.MqttCallback, org.springframework.beans.factory.DisposableBean
  • Field Details

    • log

      protected org.slf4j.Logger log
    • shutdownInProgress

      protected boolean shutdownInProgress
  • Constructor Details

    • MqttWesClient

      public MqttWesClient()
  • Method Details

    • start

      public void start()
    • isShutdownInProgress

      public boolean isShutdownInProgress()
    • stop

      public void stop()
    • onEvent

      public void onEvent(WesEvent event)
      Specified by:
      onEvent in interface WesEventListener
    • labelToSubTopic

      public String labelToSubTopic(String label)
    • connectionLost

      public void connectionLost(Throwable cause)
      Specified by:
      connectionLost in interface org.eclipse.paho.client.mqttv3.MqttCallback
    • resetReconnectionState

      public void resetReconnectionState()
      Reset reconnection counters (can be called when connection is manually restored)
    • isReconnecting

      public boolean isReconnecting()
      Get current reconnection status
    • getReconnectionAttempts

      public int getReconnectionAttempts()
      Get current number of reconnection attempts
    • republishHomeAssistantDiscovery

      public void republishHomeAssistantDiscovery()
      Re-publish Home Assistant discovery messages This can be called manually or after reconnection
    • messageArrived

      public void messageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage message) throws Exception
      Specified by:
      messageArrived in interface org.eclipse.paho.client.mqttv3.MqttCallback
      Throws:
      Exception
    • deliveryComplete

      public void deliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken token)
      Specified by:
      deliveryComplete in interface org.eclipse.paho.client.mqttv3.MqttCallback
    • setWesServer

      public void setWesServer(WesServer wesServer)
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception