Class MqttApiControllerImpl

    • Field Detail

      • config

        protected io.openems.edge.controller.api.mqtt.Config config
    • Constructor Detail

      • MqttApiControllerImpl

        public MqttApiControllerImpl()
    • Method Detail

      • logInfo

        protected void logInfo​(org.slf4j.Logger log,
                               java.lang.String message)
        Description copied from class: AbstractOpenemsComponent
        Log an info message including the Component ID.
        Overrides:
        logInfo in class AbstractOpenemsComponent
        Parameters:
        log - the Logger instance
        message - the message
      • logWarn

        protected void logWarn​(org.slf4j.Logger log,
                               java.lang.String message)
        Description copied from class: AbstractOpenemsComponent
        Log a warn message including the Component ID.
        Overrides:
        logWarn in class AbstractOpenemsComponent
        Parameters:
        log - the Logger instance
        message - the message
      • handleEvent

        public void handleEvent​(org.osgi.service.event.Event event)
        Specified by:
        handleEvent in interface org.osgi.service.event.EventHandler
      • publish

        protected boolean publish​(java.lang.String subTopic,
                                  org.eclipse.paho.mqttv5.common.MqttMessage message)
        Publish a message to a topic.
        Parameters:
        subTopic - the MQTT topic. The global MQTT Topic prefix is added in front of this string
        message - the message
        Returns:
        true if message was successfully published; false otherwise
      • publish

        protected boolean publish​(java.lang.String subTopic,
                                  java.lang.String message,
                                  int qos,
                                  boolean retained,
                                  org.eclipse.paho.mqttv5.common.packet.MqttProperties properties)
        Publish a message to a topic.
        Parameters:
        subTopic - the MQTT topic. The global MQTT Topic prefix is added in front of this string
        message - the message; internally translated to a UTF-8 byte array
        qos - the MQTT QOS
        retained - the MQTT retained parameter
        properties - the MqttProperties
        Returns:
        true if message was successfully published; false otherwise