Class MessageClient

java.lang.Object
net.bjmsw.hda.vs.helper.MessageClient

public class MessageClient extends Object
The MessageClient class provides methods to publish messages using the MQTT protocol.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The SpielEvent class represents an event that occurred in a game.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) org.eclipse.paho.client.mqttv3.MqttClient
    This variable represents an MQTT client used to publish messages using the MQTT protocol.
  • Constructor Summary

    Constructors
    Constructor
    Description
    The MQTT client used to publish messages.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    publishLeaderTrigger(long spielId)
    Publishes a leader trigger event to the MQTT broker for a specified Spiel ID.
    void
    Publishes a Spiel event to the MQTT broker.

    Methods inherited from class java.lang.Object

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

    • client

      org.eclipse.paho.client.mqttv3.MqttClient client
      This variable represents an MQTT client used to publish messages using the MQTT protocol.
  • Constructor Details

    • MessageClient

      public MessageClient() throws org.eclipse.paho.client.mqttv3.MqttException
      The MQTT client used to publish messages.
      Throws:
      org.eclipse.paho.client.mqttv3.MqttException
  • Method Details

    • publishSpielEvent

      public void publishSpielEvent(Spiel spiel, MessageClient.SpielEvent event) throws org.eclipse.paho.client.mqttv3.MqttException
      Publishes a Spiel event to the MQTT broker.
      Parameters:
      spiel - The Spiel object representing the game.
      event - The SpielEvent object representing the event.
      Throws:
      org.eclipse.paho.client.mqttv3.MqttException - if there is an error during the publishing process.
    • publishLeaderTrigger

      public void publishLeaderTrigger(long spielId)
      Publishes a leader trigger event to the MQTT broker for a specified Spiel ID.
      Parameters:
      spielId - The ID of the Spiel for which the leader trigger event is being published.