Class MQTTProtocolSupport
java.lang.Object
org.apache.activemq.transport.mqtt.MQTTProtocolSupport
A set of static methods useful for handling MQTT based client connections.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 that the Topic names given by client commands are valid based on the MQTT protocol specification.
-
Constructor Details
-
MQTTProtocolSupport
public MQTTProtocolSupport()
-
-
Method Details
-
convertMQTTToActiveMQ
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
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
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
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.
-