Class MQTTProtocolSupport

java.lang.Object
org.apache.activemq.transport.mqtt.MQTTProtocolSupport

public class MQTTProtocolSupport extends Object
A set of static methods useful for handling MQTT based client connections.
  • Constructor Details

    • MQTTProtocolSupport

      public MQTTProtocolSupport()
  • Method Details

    • convertMQTTToActiveMQ

      public static String convertMQTTToActiveMQ(String name)
      Converts an MQTT formatted Topic name into a suitable ActiveMQ Destination name string.
      Parameters:
      name - the MQTT formatted topic name.
      Returns:
      an destination name that fits the ActiveMQ conventions.
    • convertActiveMQToMQTT

      public static String convertActiveMQToMQTT(String destinationName)
      Converts an ActiveMQ destination name into a correctly formatted MQTT destination name.
      Parameters:
      destinationName - the ActiveMQ destination name to process.
      Returns:
      a destination name formatted for MQTT.
    • commandType

      public static String commandType(byte header)
      Given an MQTT header byte, determine the command type that the header represents.
      Parameters:
      header - the byte value for the MQTT frame header.
      Returns:
      a string value for the given command type.
    • validate

      public static void validate(String topicName) throws MQTTProtocolException
      Validate that the Topic names given by client commands are valid based on the MQTT protocol specification.
      Parameters:
      topicName - the given Topic name provided by the client.
      Throws:
      MQTTProtocolException - if the value given is invalid.