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 Summary
Constructors Constructor Description MQTTProtocolSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcommandType(byte header)Given an MQTT header byte, determine the command type that the header represents.static StringconvertActiveMQToMQTT(String destinationName)Converts an ActiveMQ destination name into a correctly formatted MQTT destination name.static StringconvertMQTTToActiveMQ(String name)Converts an MQTT formatted Topic name into a suitable ActiveMQ Destination name string.static voidvalidate(String topicName)Validate that the Topic names given by client commands are valid based on the MQTT protocol specification.
-
-
-
Method Detail
-
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.
-
-